Skip to content

Node.js based forum software built for the modern web

fix: closes #6784 (#7137)

Andrew Rodrigues7fb29f4272fc
diff --git a/public/src/app.js b/public/src/app.js
index e2783f17b2..2312a57a53 100644
--- a/public/src/app.js
+++ b/public/src/app.js
@@ -283,12 +283,12 @@ app.cacheBuster = null;
};
function highlightNavigationLink() {
- var path = window.location.pathname + window.location.search;
- $('#main-nav li').removeClass('active');
- if (path) {
- $('#main-nav li').removeClass('active').find('a[href="' + path + '"]').parent()
- .addClass('active');
- }
+ $('#main-nav li')
+ .removeClass('active')
+ .find('a')
+ .filter(function (i, x) { return window.location.pathname.startsWith(x.getAttribute('href')); })
+ .parent()
+ .addClass('active');
}
app.createUserTooltips = function (els, placement) {