Skip to content

Commit

Permalink
fixed issue with previous release
Browse files Browse the repository at this point in the history
  • Loading branch information
nunocoracao committed Sep 3, 2024
1 parent 5018b8b commit 8e9e5d0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
18 changes: 12 additions & 6 deletions assets/js/mobilemenu.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,33 @@
var menuButton = document.getElementById("menu-button");
var menuCloseButton = document.getElementById("menu-close-button");
var menuWrapper = document.getElementById("menu-wrapper");

var menuOpen = false;

menuButton.addEventListener("click", function () {
var openMenu = function (e) {
if (!menuOpen) {
menuOpen = true;
var menuWrapper = document.getElementById("menu-wrapper");
document.body.style.overflowY = "hidden";
menuButton.style.visibility = "hidden";
menuWrapper.style.visibility = "visible";
menuWrapper.style.opacity = "1";
window.onbeforeunload = function (event) {
closeMenu()
}
}
});
};

menuCloseButton.addEventListener("click", function (e) {
var closeMenu = function (e) {
if (menuOpen) {
menuOpen = false;
var menuWrapper = document.getElementById("menu-wrapper");
document.body.style.overflowY = "auto";
menuButton.style.visibility = "visible";
menuWrapper.style.visibility = "hidden";
menuWrapper.style.opacity = "0";
window.onbeforeunload = function (event) { }
e.stopPropagation();
}
});
}

menuButton.addEventListener("click", openMenu);
menuCloseButton.addEventListener("click", closeMenu);
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hugo-blowfish-theme",
"version": "2.78.0",
"version": "2.77.1",
"description": "Blowfish theme for Hugo.",
"scripts": {
"postinstall": "vendor-copy",
Expand Down

0 comments on commit 8e9e5d0

Please sign in to comment.