use full path for active menu detection

This commit is contained in:
chris
2020-08-27 13:53:48 -04:00
parent eaaea859d2
commit 92ce50e2d2
2 changed files with 12 additions and 8 deletions

View File

@@ -883,11 +883,13 @@ $(document).ready(function() {
});
//automatically open the current path
var path = window.location.pathname.split('/');
path = path[path.length-1];
let path = window.location.pathname;
if (path !== undefined) {
$("#sidebar-menu").find("a[href$='" + path + "']").addClass('sfActive');
$("#sidebar-menu").find("a[href$='" + path + "']").parents().eq(3).superclick('show');
let menuItem = $("#sidebar-menu").find("a[href$='" + path + "']");
if (menuItem !== undefined) {
menuItem.addClass('sfActive');
menuItem.parents().eq(3).superclick('show');
}
}
});