guichet/static/javascript/burger.js

21 lines
484 B
JavaScript
Raw Normal View History

2023-07-21 13:40:14 +00:00
window.addEventListener(
"pagehide",
(event) => {
if (document.getElementById('menu-checkbox')) {
if (document.getElementById('menu-checkbox').checked) {
localStorage.setItem('menuopen', true);
} else {
localStorage.removeItem('menuopen');
}
}
},
false,
);
if (document.getElementById('menu-checkbox')) {
if (localStorage.getItem('menuopen')) {
document.getElementById('menu-checkbox').checked=true;
}
}