Merge pull request #5000 from jjm2473/fix-luci-theme-material-nav-node-active
authorJo-Philipp Wich <jo@mein.io>
Tue, 25 May 2021 09:38:35 +0000 (11:38 +0200)
committerGitHub <noreply@github.com>
Tue, 25 May 2021 09:38:35 +0000 (11:38 +0200)
luci-theme-material: fix wrong active state on common prefix node

themes/luci-theme-material/htdocs/luci-static/material/js/script.js

index 1a5fce4e2db8ce43925128fd0acc006551b66c77..8ffb6b923fbe3a2494571cb8f851cf716867e49e 100755 (executable)
@@ -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();