aboutsummaryrefslogtreecommitdiff
path: root/frontend
diff options
context:
space:
mode:
authorWilliam Hergès <william@herges.fr>2025-10-03 19:15:58 +0200
committerWilliam Hergès <william@herges.fr>2025-10-03 19:15:58 +0200
commitcb19ff62a7ddbe130f2b3723ba16599a66e3df67 (patch)
treeceab92c4d695e19e128ff47f15b8d594ad8b6e8f /frontend
parent24ec3f328981a7dad54d3aae48e8feae932aed87 (diff)
feat(frontend): update quote after htmx reload
Diffstat (limited to 'frontend')
-rw-r--r--frontend/index.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/frontend/index.ts b/frontend/index.ts
index c337e43..13997b3 100644
--- a/frontend/index.ts
+++ b/frontend/index.ts
@@ -19,6 +19,9 @@ function setupAnchors() {
document.addEventListener("htmx:afterSettle", e => {
const title = e.detail.xhr.getResponseHeader("Updated-Title")
if (title?.length !== 0) document.title = title
+ const quote = e.detail.xhr.getResponseHeader("Updated-Quote")
+ if (quote?.length !== 0)
+ document.querySelector("#quote")!.innerHTML = "«&thinsp;" + quote + "&thinsp;»"
window.history.pushState({}, "", e.detail.pathInfo.finalRequestPath)
setupAnchors()
})