From 1aba495a1c1feae2a02275d2db5dcd10c877d859 Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Mon, 9 Apr 2018 20:50:41 -0400 Subject: Replace pushState with replaceState to prevent browser history clutter in Help pages. --- view/js/mod_help.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'view/js/mod_help.js') diff --git a/view/js/mod_help.js b/view/js/mod_help.js index 8ee89dd61..a37207807 100644 --- a/view/js/mod_help.js +++ b/view/js/mod_help.js @@ -53,7 +53,7 @@ $(document).ready(function () { .removeClass('selected-doco-nav') .eq(i).addClass('selected-doco-nav'); if (typeof ($('#doco-side-toc li').eq(i).find('a').attr('href').split('#')[1]) !== 'undefined') { - window.history.pushState({}, '', location.href.split('#')[0] + '#' + $('#doco-side-toc li').eq(i).find('a').attr('href').split('#')[1]); + window.history.replaceState({}, '', location.href.split('#')[0] + '#' + $('#doco-side-toc li').eq(i).find('a').attr('href').split('#')[1]); } } }); @@ -100,7 +100,7 @@ $(document).ready(function () { } // Update the address bar to reflect the loaded language - window.history.pushState({}, '', '/' + pathParts.join('/')); + window.history.replaceState({}, '', '/' + pathParts.join('/')); // Highlight the language in the language selector that is currently viewed $('.lang-selector').find('.lang-choice:contains("' + help_language + '")').addClass('active'); -- cgit v1.2.3