From 23df17233da3f16db5166cf8a05b2089bd1f006a Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Mon, 10 Mar 2025 18:39:08 +0000
Subject: [PATCH] fix(graph): make graph non-singleton, proper cleanup, fix radial
---
quartz/components/scripts/spa.inline.ts | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/quartz/components/scripts/spa.inline.ts b/quartz/components/scripts/spa.inline.ts
index df48f04..77900a6 100644
--- a/quartz/components/scripts/spa.inline.ts
+++ b/quartz/components/scripts/spa.inline.ts
@@ -75,6 +75,10 @@
if (!contents) return
+ // notify about to nav
+ const event: CustomEventMap["prenav"] = new CustomEvent("prenav", { detail: {} })
+ document.dispatchEvent(event)
+
// cleanup old
cleanupFns.forEach((fn) => fn())
cleanupFns.clear()
@@ -108,7 +112,7 @@
}
}
- // now, patch head
+ // now, patch head, re-executing scripts
const elementsToRemove = document.head.querySelectorAll(":not([spa-preserve])")
elementsToRemove.forEach((el) => el.remove())
const elementsToAdd = html.head.querySelectorAll(":not([spa-preserve])")
--
Gitblit v1.10.0