more strict URL check

This commit is contained in:
Plailect 2017-09-30 16:52:00 -04:00 committed by Plailect
parent 74d3783fb6
commit 093ed8fade
No known key found for this signature in database
GPG key ID: F8A415C5EA602A41
2 changed files with 5 additions and 2 deletions

View file

@ -209,7 +209,10 @@ $(document).ready(function(){
ol.children().each(function(idx, li) { ol.children().each(function(idx, li) {
var link = $(li).find("a").attr('href'); var link = $(li).find("a").attr('href');
var name = $(li).attr('data-name'); var name = $(li).attr('data-name');
if(window.location.href.indexOf(link) > -1 && name !== "home"){ if((window.location.href.endsWith(link) ||
window.location.href.endsWith(link + "/") ||
window.location.href.indexOf(link + "#") > -1)
&& name !== "home"){
$(li).addClass("active"); $(li).addClass("active");
return false; return false;
} }

File diff suppressed because one or more lines are too long