From 5a42f8f4553c10a1e3dc9df844e5a9ea6338848e Mon Sep 17 00:00:00 2001 From: Razon Yang Date: Tue, 5 Nov 2024 10:21:33 +0800 Subject: [PATCH] fix: avoid changing non-menu links state (#730) --- assets/hb/modules/header/js/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/hb/modules/header/js/index.ts b/assets/hb/modules/header/js/index.ts index da1051b2..14b7d791 100644 --- a/assets/hb/modules/header/js/index.ts +++ b/assets/hb/modules/header/js/index.ts @@ -31,7 +31,7 @@ import "js/bootstrap/src/offcanvas"; return window.location.href.indexOf(href) !== -1 || window.location.pathname.indexOf(href) !== -1 } - const menus = nav.querySelectorAll(`a[href="${window.location.href}"], a[href="${window.location.pathname}"]`) + const menus = nav.querySelectorAll(`.hb-header-menus a[href="${window.location.href}"],.hb-header-menus a[href="${window.location.pathname}"]`) if (menus.length > 0) { menus.forEach(menu => { activeMenu(menu)