From 97d50d2c6b80805cd7e513eeafc8b62fef4ab1b6 Mon Sep 17 00:00:00 2001 From: Liangbin Lian Date: Wed, 21 Apr 2021 18:00:48 +0800 Subject: 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 --- themes/luci-theme-material/htdocs/luci-static/material/js/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'themes/luci-theme-material/htdocs/luci-static') diff --git a/themes/luci-theme-material/htdocs/luci-static/material/js/script.js b/themes/luci-theme-material/htdocs/luci-static/material/js/script.js index 1a5fce4e2d..8ffb6b923f 100755 --- a/themes/luci-theme-material/htdocs/luci-static/material/js/script.js +++ b/themes/luci-theme-material/htdocs/luci-static/material/js/script.js @@ -68,7 +68,7 @@ document.addEventListener('luci-loaded', function(ev) { var that = $(this); var href = that.attr("href"); - if (href.indexOf(nodeUrl) != -1) { + if (href.endsWith(nodeUrl) || href.indexOf('/' + nodeUrl + '/') != -1) { ulNode.click(); ulNode.next(".slide-menu").stop(true, true); lastNode = that.parent(); -- cgit v1.2.3