luci-theme-material: fix wrong active state on common prefix node

Before fixed, if we have two nodes: 'services/ddns' and 'services/ddnsto',
click any one of they, will show they all actived.

Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
(cherry picked from commit 97d50d2c6b)
This commit is contained in:
Liangbin Lian 2021-04-21 18:00:48 +08:00 committed by Hannu Nyman
parent 19de3acdde
commit ac0bcc2d10

View file

@ -68,7 +68,7 @@ document.addEventListener('luci-loaded', function(ev) {
var that = $(this); var that = $(this);
var href = that.attr("href"); var href = that.attr("href");
if (href.indexOf(nodeUrl) != -1) { if (href.endsWith(nodeUrl) || href.indexOf('/' + nodeUrl + '/') != -1) {
ulNode.click(); ulNode.click();
ulNode.next(".slide-menu").stop(true, true); ulNode.next(".slide-menu").stop(true, true);
lastNode = that.parent(); lastNode = that.parent();