From 7fb29f4272fc371dcc3b6f5ea478b87c21876b48 Mon Sep 17 00:00:00 2001 From: Andrew Rodrigues Date: Wed, 19 Dec 2018 16:16:35 -0500 Subject: [PATCH] fix: closes #6784 (#7137) * fix: closes #6784 * #6784 also fix homepage + subfolder installs * #6784 fixes suburls as well (ex. /tags/x and /groups/y) * #6784 more elegant solution @pitaj and the last time I touch this function, lol * #6784 regis, final answer I lied in that last commit --- public/src/app.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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) {