forked from cadence/breezewiki
Fix scrolling to sections if a tab's hash coincides with one
ben10/wiki/Alien_X_(Classic)#Appearances
This commit is contained in:
parent
2277c53956
commit
d5f992b7d8
1 changed files with 4 additions and 1 deletions
|
@ -66,6 +66,9 @@ function setCurrentTab(tabber, tab, content) {
|
||||||
tab.classList.add("wds-is-current");
|
tab.classList.add("wds-is-current");
|
||||||
content.classList.add("wds-is-current");
|
content.classList.add("wds-is-current");
|
||||||
if (tab.dataset.hash) {
|
if (tab.dataset.hash) {
|
||||||
location.hash = "#" + tab.dataset.hash;
|
let fragment = "#" + tab.dataset.hash;
|
||||||
|
if (location.hash !== fragment) {
|
||||||
|
history.pushState(null, "", fragment);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue