mirror of
https://github.com/quartz-community/explorer.git
synced 2026-07-22 02:50:24 +00:00
feat: add render event listener for in-place DOM re-initialization
This commit is contained in:
parent
42e90f1a73
commit
def459f31b
1 changed files with 5 additions and 2 deletions
|
|
@ -230,7 +230,7 @@ function renderTree(node, container, currentSlug, folderBehavior, savedState, pa
|
|||
}
|
||||
}
|
||||
|
||||
document.addEventListener("nav", async (e) => {
|
||||
async function handleNavOrRender(e) {
|
||||
const thisGeneration = ++currentRenderGeneration;
|
||||
try {
|
||||
console.log("[Explorer] Nav event received, generation:", thisGeneration);
|
||||
|
|
@ -403,7 +403,10 @@ document.addEventListener("nav", async (e) => {
|
|||
} catch (err) {
|
||||
console.error("[Explorer] Fatal error in nav handler:", err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener("nav", handleNavOrRender);
|
||||
document.addEventListener("render", handleNavOrRender);
|
||||
|
||||
document.addEventListener("prenav", () => {
|
||||
const explorer = document.querySelector(".explorer-ul");
|
||||
|
|
|
|||
Loading…
Reference in a new issue