js: add class to keep track of details opening status (#83376)
This commit is contained in:
parent
9dd8021f68
commit
7578b0a0cf
|
@ -481,6 +481,15 @@ var gadjo_js = gadjo_js || {};
|
|||
sessionStorage['gadjo-foldable-id-' + $parent[0].id + '-' + window.location.pathname] = ! $parent.is('.gadjo-folded');
|
||||
}
|
||||
});
|
||||
|
||||
document.querySelectorAll('details.gadjo-remember-open-status').forEach(
|
||||
el => {
|
||||
const key = 'gadjo-foldable-id-' + el.id + '-' + window.location.pathname
|
||||
if (sessionStorage[key] !== undefined) el.open = (sessionStorage[key] === "true")
|
||||
el.addEventListener('toggle', (e) => sessionStorage[key] = el.open)
|
||||
}
|
||||
)
|
||||
|
||||
});
|
||||
$(function () { /* foldable sections */
|
||||
$('.section.foldable > h2, .section.foldable > h3').on('click', function() {
|
||||
|
|
Loading…
Reference in New Issue