mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-11-08 03:39:42 +01:00
Fix navigation menu buttons changing tab
Better fix Affects: - Note #1617
This commit is contained in:
parent
f46418d1f9
commit
19c904d047
@ -52,8 +52,8 @@ for (let tab of tabs) {
|
||||
window.addEventListener('hashchange', openPage);
|
||||
|
||||
//Sidebar navigation tabs
|
||||
$('#accordionSidebar .nav-button, #accordionSidebar .nav-button a').click(event => {
|
||||
if (history.replaceState) {
|
||||
$('#accordionSidebar .nav-item a').click(event => {
|
||||
if (history.replaceState && event.currentTarget.href.split('#')[1].length > 0) {
|
||||
event.preventDefault();
|
||||
history.replaceState(undefined, undefined, '#' + event.currentTarget.href.split('#')[1]);
|
||||
openPage();
|
||||
@ -66,7 +66,7 @@ $('.nav-tabs a.nav-link').click(event => {
|
||||
if (!uriHash) return;
|
||||
const currentTab = uriHash[0];
|
||||
const originalTargetId = event.currentTarget.href.split('#')[1];
|
||||
if(history.replaceState) {
|
||||
if (history.replaceState) {
|
||||
event.preventDefault();
|
||||
history.replaceState(undefined, undefined, currentTab + '&' + originalTargetId);
|
||||
openPage();
|
||||
|
Loading…
Reference in New Issue
Block a user