Skip to content

Commit c597d7d

Browse files
committed
remove query param in favor of hash
1 parent e99c039 commit c597d7d

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/Admin/Settings/SettingsRegistry.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ public function show_forms() {
678678
/**
679679
* Tabbable JavaScript codes & Initiate Color Picker
680680
*
681-
* This code uses query arguments and localstorage for displaying active tabs
681+
* This code uses URL hash fragments and localStorage for displaying active tabs
682682
*
683683
* @return void
684684
*/
@@ -692,11 +692,10 @@ public function script() {
692692
// Switches option sections
693693
$('.group').hide();
694694
var activetab = '';
695-
var urlParams = new URLSearchParams(window.location.search);
696-
var queryTab = urlParams.get('tab');
695+
var urlHash = window.location.hash;
697696

698-
if (queryTab) {
699-
activetab = '#' + queryTab;
697+
if (urlHash) {
698+
activetab = urlHash;
700699
if (typeof (localStorage) != 'undefined') {
701700
localStorage.setItem("activetab", activetab);
702701
}
@@ -734,8 +733,7 @@ function () {
734733
if (typeof (localStorage) != 'undefined') {
735734
localStorage.setItem("activetab", clicked_group);
736735
}
737-
urlParams.set('tab', clicked_group.substring(1));
738-
history.replaceState(null, '', '?' + urlParams.toString());
736+
history.replaceState(null, '', clicked_group);
739737
$('.group').hide();
740738
$(clicked_group).fadeIn();
741739
evt.preventDefault();

0 commit comments

Comments
 (0)