Make mobile menu full height and fix transition

This commit is contained in:
prototypa
2022-08-28 18:07:47 -04:00
parent e1c271441b
commit f496dd0ccd
2 changed files with 15 additions and 16 deletions

View File

@ -17,13 +17,7 @@ const { } = Astro.props;
const matches = document.querySelectorAll(selector);
if (matches && matches.length) {
matches.forEach((elem) => {
elem.addEventListener(
event,
function () {
fn(elem);
},
false
);
elem.addEventListener(event, () => fn(elem), false);
});
}
}
@ -31,6 +25,7 @@ const { } = Astro.props;
window.onload = function () {
attachEvent("[data-aw-toggle-menu]", "click", function (elem) {
elem.classList.toggle("expanded");
document.documentElement.classList.toggle("overflow-hidden");
document.getElementById("menu")?.classList.toggle("hidden");
});