refactor: some work to get initial page load working a bit better

This commit is contained in:
Andy Burke 2025-07-04 13:08:00 -07:00
parent 200b89954b
commit f276fe74da
3 changed files with 98 additions and 41 deletions

View file

@ -2,7 +2,13 @@
window.addEventListener("locationchange", () => {
const hash = window.location.hash?.slice(1);
if (hash) {
const target_tab = document.querySelector(`[data-hash="${hash}"]`);
const target_tab_url = hash.slice(0, hash.slice(1).indexOf("/"));
const target_tab = document.querySelector(`[data-hash="${target_tab_url}"]`);
console.dir({
hash,
target_tab_url,
target_tab,
});
if (target_tab) {
target_tab.click();
}