Skip to content

Commit

Permalink
Added hash to URL of page when clicking on a tab to facilitate refere…
Browse files Browse the repository at this point in the history
…nces to the specific tab.
  • Loading branch information
atteggiani committed Sep 21, 2024
1 parent de486b2 commit 072ae04
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/js/miscellaneous.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ function tabFunctionality() {
elem.classList.add('activeTab');
}
});
// Add tab ID hash to URL
history.pushState(null, null, `#${tab.id}`);
// Save active tab to sessionStorage
sessionStorage.setItem(`tabs-label=${label}`,`${tab.id}`);
}
Expand Down

0 comments on commit 072ae04

Please sign in to comment.