fixed mobile bar close event

This commit is contained in:
2026-05-08 10:00:52 +02:00
parent f50d76e033
commit 2b337a848a
3 changed files with 12 additions and 2 deletions
+3 -2
View File
@@ -66,11 +66,12 @@ async function loadData() {
const sidebar_top = document.getElementById("sidebar-top-content");
const navbar_mobile = document.getElementById("navbar-mobile");
const button_mobile2 = document.getElementById("button_mobile");
const button_mobile2 = document.getElementById("button-mobile");
document.addEventListener("click", (e) => {
if (!e.target.closest("navbar-mobile") && button_mobile2.classList.contains("inactive")) {
if (!e.target.closest("#navbar-mobile") && !e.target.closest("#button-mobile") && !navbar_mobile.classList.contains("inactive")) {
navbar_mobile.classList.add("inactive");
button_mobile2.classList.remove("inactive");
}
});