mirror of
https://gitdab.com/cadence/breezewiki.git
synced 2026-03-05 13:40:27 -05:00
Fix scrolling to sections if a tab's hash coincides with one
ben10/wiki/Alien_X_(Classic)#Appearances
This commit is contained in:
@@ -66,6 +66,9 @@ function setCurrentTab(tabber, tab, content) {
|
||||
tab.classList.add("wds-is-current");
|
||||
content.classList.add("wds-is-current");
|
||||
if (tab.dataset.hash) {
|
||||
location.hash = "#" + tab.dataset.hash;
|
||||
let fragment = "#" + tab.dataset.hash;
|
||||
if (location.hash !== fragment) {
|
||||
history.pushState(null, "", fragment);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user