From 62b62821c14fb242446dc415e36a08deb6ee60f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 17 Nov 2020 21:20:20 -0500 Subject: [PATCH] fix: navigation highlight /top was getting hightlighted in navigation if you went into a /topic --- public/src/app.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/src/app.js b/public/src/app.js index b8ae62ac7b..14a3593917 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -244,7 +244,10 @@ app.cacheBuster = null; $('#main-nav li') .removeClass('active') .find('a') - .filter(function (i, x) { return window.location.pathname.startsWith(x.getAttribute('href')); }) + .filter(function (i, x) { + return window.location.pathname === x.pathname || + window.location.pathname.startsWith(x.pathname + '/'); + }) .parent() .addClass('active'); }