X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=themes%2Fluci-theme-material%2Fhtdocs%2Fluci-static%2Fmaterial%2Fjs%2Fscript.js;h=fdd23e8cd2d6b67498a6246be1c62c301471b275;hp=604c4da8a8860ab87ebe63f2aa101d6d5c52fdfe;hb=f9e590a;hpb=5a0c3bbfa96ea7b4845402e1f776744a86df6cb7;ds=sidebyside 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 604c4da8a..fdd23e8cd 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 @@ -144,11 +144,10 @@ function getCurrentNodeByUrl() { var ret = false; var getUrlNode = function (href){ - var linkPos = href.indexOf(";"); - if (linkPos == -1){ + if (!$('body').hasClass('logged-in')){ return "login"; }else{ - linkPos = href.indexOf("/", linkPos); + var linkPos = href.indexOf("/", linkPos); if (linkPos == -1){ return "overview"; }else{ @@ -201,9 +200,9 @@ if (!ul.is(":visible")) { menu.addClass("active"); ul.addClass("active"); - ul.stop(true).slideDown(); + ul.stop(true).slideDown("fast"); } else { - ul.slideUp(function () { + ul.stop(true).slideUp("fast", function () { menu.removeClass("active"); ul.removeClass("active"); }); @@ -274,16 +273,16 @@ var showSide = false; $(".showSide").click(function () { if (showSide){ - $(".darkMask").stop(true).fadeOut(); + $(".darkMask").stop(true).fadeOut("fast"); $(".main-left").stop(true).animate({ width: "0" - }); + },"fast"); showSide = false; }else{ - $(".darkMask").stop(true).fadeIn(); + $(".darkMask").stop(true).fadeIn("fast"); $(".main-left").stop(true).animate({ width: "15rem" - }); + },"fast"); showSide = true; } }); @@ -292,10 +291,10 @@ $(".darkMask").click(function () { if (showSide){ showSide = false; - $(".darkMask").stop(true).fadeOut(); + $(".darkMask").stop(true).fadeOut("fast"); $(".main-left").stop(true).animate({ width: "0" - }); + },"fast"); } }); @@ -342,4 +341,13 @@ break; } } + + + document.addEventListener("touchmove", function(evt){ + evt.preventDefault(); + }, false); + var container = document.getElementById("maincontent"); + container.addEventListener("touchmove", function(evt){ + evt.stopPropagation(); + }, false); })(jQuery);