add: multiple pages in one entry, details syntax
This commit is contained in:
parent
db63427795
commit
a127a0407d
3 changed files with 217 additions and 4 deletions
|
@ -349,3 +349,20 @@ globalThis.toggle_metadata_css = (e) => {
|
|||
window.location.reload();
|
||||
}
|
||||
};
|
||||
|
||||
globalThis.hash_check = (hash) => {
|
||||
if (hash.startsWith("#/")) {
|
||||
for (const x of Array.from(document.querySelectorAll(".subpage"))) {
|
||||
x.classList.add("hidden");
|
||||
}
|
||||
|
||||
document.getElementById(hash).classList.remove("hidden");
|
||||
}
|
||||
};
|
||||
|
||||
window.addEventListener("hashchange", (_) => hash_check(window.location.hash));
|
||||
|
||||
setTimeout(() => {
|
||||
// run initial hash check
|
||||
hash_check(window.location.hash);
|
||||
}, 150);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue