mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-11-08 11:50:10 +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);
|
window.addEventListener('hashchange', openPage);
|
||||||
|
|
||||||
//Sidebar navigation tabs
|
//Sidebar navigation tabs
|
||||||
$('#accordionSidebar .nav-button, #accordionSidebar .nav-button a').click(event => {
|
$('#accordionSidebar .nav-item a').click(event => {
|
||||||
if (history.replaceState) {
|
if (history.replaceState && event.currentTarget.href.split('#')[1].length > 0) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
history.replaceState(undefined, undefined, '#' + event.currentTarget.href.split('#')[1]);
|
history.replaceState(undefined, undefined, '#' + event.currentTarget.href.split('#')[1]);
|
||||||
openPage();
|
openPage();
|
||||||
@ -66,7 +66,7 @@ $('.nav-tabs a.nav-link').click(event => {
|
|||||||
if (!uriHash) return;
|
if (!uriHash) return;
|
||||||
const currentTab = uriHash[0];
|
const currentTab = uriHash[0];
|
||||||
const originalTargetId = event.currentTarget.href.split('#')[1];
|
const originalTargetId = event.currentTarget.href.split('#')[1];
|
||||||
if(history.replaceState) {
|
if (history.replaceState) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
history.replaceState(undefined, undefined, currentTab + '&' + originalTargetId);
|
history.replaceState(undefined, undefined, currentTab + '&' + originalTargetId);
|
||||||
openPage();
|
openPage();
|
||||||
|
Loading…
Reference in New Issue
Block a user