fix: navigation highlight

/top was getting hightlighted in navigation if you went into a /topic
This commit is contained in:
Barış Soner Uşaklı
2020-11-17 21:20:20 -05:00
parent c2019b7b3a
commit 62b62821c1

View File

@@ -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');
}