From 9957ab55c1e6df2efe7da685b62182ba917ec1b2 Mon Sep 17 00:00:00 2001 From: Eyal Soha Date: Sun, 15 Apr 2018 09:06:45 +0300 Subject: [PATCH] fix merge with 1.3.7 --- src/octoprint/static/js/app/main.js | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/src/octoprint/static/js/app/main.js b/src/octoprint/static/js/app/main.js index 4e69237bfb..5f980c3f75 100644 --- a/src/octoprint/static/js/app/main.js +++ b/src/octoprint/static/js/app/main.js @@ -503,7 +503,6 @@ $(function() { log.debug("Selected OctoPrint tab changed: previous = " + previous + ", current = " + current); OctoPrint.coreui.selectedTab = current; callViewModels(allViewModels, "onTabChange", [current, previous]); - window.history.replaceState(window.history.state, "", current); }; var onAfterTabChange = function(current, previous) { @@ -528,6 +527,7 @@ $(function() { $('html,body').scrollTop(scrollmem); }); + onTabChange(OCTOPRINT_INITIAL_TAB); onAfterTabChange(OCTOPRINT_INITIAL_TAB, undefined); var changeTab = function() { @@ -539,6 +539,7 @@ $(function() { tab.tab("show"); } }; + // Fix input element click problems on dropdowns $(".dropdown input, .dropdown label").click(function(e) { e.stopPropagation(); @@ -552,15 +553,6 @@ $(function() { // reload overlay $("#reloadui_overlay_reload").click(function() { location.reload(); }); - var changeTab = function() - { - var hashtag = window.location.hash; - - var tab = $('#tabs a[href="' + hashtag + '"]'); - tab.tab("show"); - onTabChange(hashtag); - } - //~~ final initialization - passive login, settings fetch, view model binding if (!_.has(viewModelMap, "settingsViewModel")) { @@ -680,15 +672,6 @@ $(function() { changeTab(); }); - if (window.location.hash != "") - { - changeTab(); - } - - $(window).on("hashchange", function() { - changeTab(); - }); - if (window.location.hash !== "") { changeTab(); }