From da5fd96e5e9364a6ae26a9a2ffe5dad294d93ec7 Mon Sep 17 00:00:00 2001 From: Marin Ivanov Date: Tue, 20 Aug 2024 15:36:06 +0300 Subject: fix hash handling --- app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app.js') diff --git a/app.js b/app.js index 8dec438..aa1fcdc 100644 --- a/app.js +++ b/app.js @@ -97,8 +97,8 @@ const routes = { p("The requested page is not available.") ), }; -const onchange = () => { - doc.querySelectorAll('nav a').forEach(x => x.$cls((location.href===x.href)?"active":"")); +const onchange = (h) => { + doc.querySelectorAll('nav a').forEach(x => x.$cls(x.attr("href")===h?"active":"")); loading(isLoading); }; -- cgit v1.2.3