Add better support for tabs #15

Manually merged
cadence merged 5 commits from blankie/breezewiki:tabs into main 2024-06-05 11:09:06 +00:00
Showing only changes of commit 2b3a8fe108 - Show all commits

View file

@ -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);
}
} }
} }