MediaWiki:Common.js: Difference between revisions

No edit summary
No edit summary
Tag: Manual revert
 
(4 intermediate revisions by the same user not shown)
Line 47: Line 47:
     if (osString.includes("mac")) userOs = "mac";
     if (osString.includes("mac")) userOs = "mac";
     if (osString.includes("win")) userOs = "win";
     if (osString.includes("win")) userOs = "win";
    const oldAnchor = window.location.hash;
     tabber.querySelectorAll(".tabber__header > .tabber__tabs > a.tabber__tab").forEach(tab => {
     tabber.querySelectorAll(".tabber__header > .tabber__tabs > a.tabber__tab").forEach(tab => {
         const tabName = tab.textContent.toLowerCase();
         const tabName = tab.textContent.toLowerCase();
Line 53: Line 55:
         if (userOs === "win" && tabName.includes("windows")) tab.click();
         if (userOs === "win" && tabName.includes("windows")) tab.click();
     });
     });
    setTimeout(() => {
        window.location.hash = oldAnchor;
    }, 100);
});
});