diff --git a/view/template/nav/_header.php b/view/template/nav/_header.php index e7f8a8f1..1798adeb 100644 --- a/view/template/nav/_header.php +++ b/view/template/nav/_header.php @@ -193,19 +193,26 @@ Menu + if (window.innerWidth < 951) { + console.log("yep"); + } + document.getElementById("menuToggle").addEventListener("click", event => { event.preventDefault(); - const body = document.querySelector("body"); - const navigation = document.querySelector("drawer-navigation"); + if (window.innerWidth < 951) { + console.log("yep"); + const body = document.querySelector("body"); + const navigation = document.querySelector("drawer-navigation"); - navigation.classList.toggle("active"); + navigation.classList.toggle("active"); - // Get rid of double scrollbars - if (navigation.classList.contains("active")) - body.style["overflow-y"] = "hidden"; - else - body.style["overflow-y"] = "auto"; + // Get rid of double scrollbars + if (navigation.classList.contains("active")) + body.style["overflow-y"] = "hidden"; + else + body.style["overflow-y"] = "initial"; + } }); diff --git a/web/scss/components/_header.scss b/web/scss/components/_header.scss index 66d76285..6d42385f 100644 --- a/web/scss/components/_header.scss +++ b/web/scss/components/_header.scss @@ -246,6 +246,13 @@ drawer-title { } drawer-wrap { + &::after { + // TODO: Update component with this code + // and remove `width` and `height` + left: 0; bottom: 0; right: 0; + position: fixed; + } + @media (max-width: 950px) { top: initial; left: initial;