mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-09 06:46:10 +01:00
use full path for active menu detection
This commit is contained in:
@@ -883,11 +883,13 @@ $(document).ready(function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
//automatically open the current path
|
//automatically open the current path
|
||||||
var path = window.location.pathname.split('/');
|
let path = window.location.pathname;
|
||||||
path = path[path.length-1];
|
|
||||||
if (path !== undefined) {
|
if (path !== undefined) {
|
||||||
$("#sidebar-menu").find("a[href$='" + path + "']").addClass('sfActive');
|
let menuItem = $("#sidebar-menu").find("a[href$='" + path + "']");
|
||||||
$("#sidebar-menu").find("a[href$='" + path + "']").parents().eq(3).superclick('show');
|
if (menuItem !== undefined) {
|
||||||
|
menuItem.addClass('sfActive');
|
||||||
|
menuItem.parents().eq(3).superclick('show');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -883,11 +883,13 @@ $(document).ready(function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
//automatically open the current path
|
//automatically open the current path
|
||||||
var path = window.location.pathname.split('/');
|
let path = window.location.pathname;
|
||||||
path = path[path.length-1];
|
|
||||||
if (path !== undefined) {
|
if (path !== undefined) {
|
||||||
$("#sidebar-menu").find("a[href$='" + path + "']").addClass('sfActive');
|
let menuItem = $("#sidebar-menu").find("a[href$='" + path + "']");
|
||||||
$("#sidebar-menu").find("a[href$='" + path + "']").parents().eq(3).superclick('show');
|
if (menuItem !== undefined) {
|
||||||
|
menuItem.addClass('sfActive');
|
||||||
|
menuItem.parents().eq(3).superclick('show');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user