From 2237aab76b6876bc9bc1c0c0fad818898cfbe495 Mon Sep 17 00:00:00 2001 From: Lutty Yang Date: Fri, 18 Sep 2015 11:32:44 +0800 Subject: luci-theme-material: fix some bug fixed "logout" text theme error and "unsaved changes" page dislocation. Signed-off-by: Lutty Yang --- .../luci-theme-material/htdocs/luci-static/material/js/script.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'themes/luci-theme-material/htdocs/luci-static/material/js/script.js') 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 b6e0db4740..c7d60b9e34 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 @@ -260,14 +260,16 @@ */ if (!getCurrentNodeByUrl()){ getCurrentNodeByHash(); - if (tree[0] == "Status" && tree[1] == "Overview"){ + if (tree != undefined && tree[0] == "Status" && tree[1] == "Overview"){ //overview lastNode.addClass("active"); $($(".main > .main-left > .nav > .slide > .menu")[0]).click(); } } - var mainNodeName = "node-"+ tree[0] + "-" + tree[1]; - $("body").addClass(mainNodeName.replace(/[ \t\n\r\/]+/g,"_").toLowerCase()); + if (tree != undefined){ + var mainNodeName = "node-"+ tree[0] + "-" + tree[1]; + $("body").addClass(mainNodeName.replace(/[ \t\n\r\/]+/g,"_").toLowerCase()); + } $(".cbi-button-up").val(""); $(".cbi-button-down").val(""); -- cgit v1.2.3