From 11e335348e4eb680f42b2c5e234ca89abfa8bea6 Mon Sep 17 00:00:00 2001 From: prototypa Date: Tue, 8 Aug 2023 09:03:52 -0400 Subject: [PATCH] Fix issue #213 - Click on the blank space of the navigation ... --- src/components/common/BasicScripts.astro | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/components/common/BasicScripts.astro b/src/components/common/BasicScripts.astro index 092301c..8b77eb4 100644 --- a/src/components/common/BasicScripts.astro +++ b/src/components/common/BasicScripts.astro @@ -35,14 +35,7 @@ import { UI_CONFIG } from '~/utils/config'; let lastKnownScrollPosition = window.scrollY; let ticking = true; - attachEvent('#header nav', 'click', function () { - document.querySelector("[data-aw-toggle-menu]")?.classList.remove("expanded"); - document.body.classList.remove("overflow-hidden"); - document.getElementById("header")?.classList.remove("h-screen"); - document.querySelector("#header nav")?.classList.add("hidden"); - }); - - attachEvent('[data-aw-toggle-menu]', 'click', function () { + attachEvent('[data-aw-toggle-menu], #header nav', 'click', function () { document.body.classList.toggle("overflow-hidden"); document.getElementById("header")?.classList.toggle("h-screen"); document.getElementById("header")?.classList.toggle("expanded");