From 9dab8c9138648a1276f5e08d31bb8672adc592fd Mon Sep 17 00:00:00 2001 From: vintro Date: Tue, 11 Nov 2025 17:06:52 -0500 Subject: [PATCH] fix: collapse not working inside blog post --- quartz/components/scripts/explorer.inline.ts | 2 +- quartz/components/scripts/toc.inline.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/quartz/components/scripts/explorer.inline.ts b/quartz/components/scripts/explorer.inline.ts index 3eb25ead42e40..5dba57a9f0f1d 100644 --- a/quartz/components/scripts/explorer.inline.ts +++ b/quartz/components/scripts/explorer.inline.ts @@ -21,7 +21,7 @@ function toggleExplorer(this: HTMLElement) { if (!content) return content.classList.toggle("collapsed") - content.style.maxHeight = content.style.maxHeight === "0px" ? content.scrollHeight + "px" : "0px" + content.style.maxHeight = content.classList.contains("collapsed") ? "0px" : content.scrollHeight + "px" } function toggleFolder(evt: MouseEvent) { diff --git a/quartz/components/scripts/toc.inline.ts b/quartz/components/scripts/toc.inline.ts index 546859ed3261b..5b67675c173d9 100644 --- a/quartz/components/scripts/toc.inline.ts +++ b/quartz/components/scripts/toc.inline.ts @@ -19,7 +19,7 @@ function toggleToc(this: HTMLElement) { const content = this.nextElementSibling as HTMLElement | undefined if (!content) return content.classList.toggle("collapsed") - content.style.maxHeight = content.style.maxHeight === "0px" ? content.scrollHeight + "px" : "0px" + content.style.maxHeight = content.classList.contains("collapsed") ? "0px" : content.scrollHeight + "px" } function setupToc() {