Merge pull request #1718 from nunocoracao/dev

🔖 v2.77.1
This commit is contained in:
Nuno Coração 2024-09-04 00:10:47 +01:00 committed by GitHub
commit 471704ebe8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 7 deletions

View file

@ -1,27 +1,33 @@
var menuButton = document.getElementById("menu-button"); var menuButton = document.getElementById("menu-button");
var menuCloseButton = document.getElementById("menu-close-button"); var menuCloseButton = document.getElementById("menu-close-button");
var menuWrapper = document.getElementById("menu-wrapper");
var menuOpen = false; var menuOpen = false;
menuButton.addEventListener("click", function () { var openMenu = function (e) {
if (!menuOpen) { if (!menuOpen) {
menuOpen = true; menuOpen = true;
var menuWrapper = document.getElementById("menu-wrapper");
document.body.style.overflowY = "hidden"; document.body.style.overflowY = "hidden";
menuButton.style.visibility = "hidden"; menuButton.style.visibility = "hidden";
menuWrapper.style.visibility = "visible"; menuWrapper.style.visibility = "visible";
menuWrapper.style.opacity = "1"; menuWrapper.style.opacity = "1";
window.onbeforeunload = function (event) {
closeMenu()
}
} }
}); };
menuCloseButton.addEventListener("click", function (e) { var closeMenu = function (e) {
if (menuOpen) { if (menuOpen) {
menuOpen = false; menuOpen = false;
var menuWrapper = document.getElementById("menu-wrapper");
document.body.style.overflowY = "auto"; document.body.style.overflowY = "auto";
menuButton.style.visibility = "visible"; menuButton.style.visibility = "visible";
menuWrapper.style.visibility = "hidden"; menuWrapper.style.visibility = "hidden";
menuWrapper.style.opacity = "0"; menuWrapper.style.opacity = "0";
window.onbeforeunload = function (event) { }
e.stopPropagation(); e.stopPropagation();
} }
}); }
menuButton.addEventListener("click", openMenu);
menuCloseButton.addEventListener("click", closeMenu);

View file

@ -1,6 +1,6 @@
{ {
"name": "hugo-blowfish-theme", "name": "hugo-blowfish-theme",
"version": "2.77.0", "version": "2.77.1",
"description": "Blowfish theme for Hugo.", "description": "Blowfish theme for Hugo.",
"scripts": { "scripts": {
"postinstall": "vendor-copy", "postinstall": "vendor-copy",