This commit is contained in:
ポール ウェッブ 2019-03-19 17:33:21 -05:00
parent 9e07c7eb60
commit 414532bf37
2 changed files with 22 additions and 8 deletions

View file

@ -193,19 +193,26 @@
<a href="#" class="header__toggle" id="menuToggle">Menu</a>
<?php js_start() ?>
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";
}
});
<?php js_end() ?>

View file

@ -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;