diff --git a/scripts/pi-hole/js/settings.js b/scripts/pi-hole/js/settings.js index 4eee5c20..0edae1bc 100644 --- a/scripts/pi-hole/js/settings.js +++ b/scripts/pi-hole/js/settings.js @@ -186,17 +186,9 @@ $("button[id^='adlist-btn-']").on("click", function (e) { }); -// Javascript to go to specified tab on save or hyperlink -$(function () { - if(location.hash.length > 0) - { - var activeTab = $("[href=" + location.hash + "]"); - activeTab && activeTab.tab("show"); - } -}); -// Change hash for save and reload +// Change "?tab=" parameter in URL for save and reload $(".nav-tabs a").on("shown.bs.tab", function (e) { - window.location.hash = e.target.hash; + window.history.pushState("", "", "?tab=" + e.target.hash.substring(1)); window.scrollTo(0, 0); }); diff --git a/settings.php b/settings.php index c6ba7a17..17235cbd 100644 --- a/settings.php +++ b/settings.php @@ -227,20 +227,27 @@ if (isset($setupVars["API_PRIVACY_MODE"])) { ?> +