Revert "luci-theme-material: do not infer login state from url (#520)"
authorHannu Nyman <hannu.nyman@iki.fi>
Fri, 23 Oct 2015 17:16:04 +0000 (20:16 +0300)
committerHannu Nyman <hannu.nyman@iki.fi>
Fri, 23 Oct 2015 17:16:04 +0000 (20:16 +0300)
This reverts commit f9e590aa4741bf337029be3f374a33543cc3f37b
in order to enable a clean merge of the PR #521 from the theme author.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
themes/luci-theme-material/htdocs/luci-static/material/js/script.js
themes/luci-theme-material/luasrc/view/themes/material/header.htm

index fdd23e8cd2d6b67498a6246be1c62c301471b275..a0f067595b5918dad8c1b3d202ac70e08f4dc38a 100755 (executable)
     function getCurrentNodeByUrl() {
         var ret = false;
         var getUrlNode = function (href){
-            if (!$('body').hasClass('logged-in')){
+            var linkPos = href.indexOf(";");
+            if (linkPos == -1){
                 return "login";
             }else{
-                var linkPos = href.indexOf("/", linkPos);
+                linkPos = href.indexOf("/", linkPos);
                 if (linkPos == -1){
                     return "overview";
                 }else{
index 153be101a56095bc5c81592e4b77a76b0be16c95..99afc065b3ed8aba3426a3fb8f7027814571874f 100755 (executable)
     <script src="<%=resource%>/xhr.js"></script>
 </head>
 
-<body class="lang_<%=luci.i18n.context.lang%> <%- if node then %><%= striptags( node.title ) %><%- end %> <% if luci.dispatcher.context.authsession then %>logged-in<% end %>">
+<body class="lang_<%=luci.i18n.context.lang%> <%- if node then %><%= striptags( node.title ) %><%- end %>">
 
 <header>
        <div class="container">