refactor: some work to get initial page load working a bit better
This commit is contained in:
parent
200b89954b
commit
f276fe74da
3 changed files with 98 additions and 41 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue