fix selectors for toc

This commit is contained in:
Tejas Sanap 2024-08-11 21:19:47 +01:00
parent bb6ccfeba8
commit 06c4b11e8f
No known key found for this signature in database
GPG Key ID: DD8C7759CA107D93

View File

@ -27,8 +27,8 @@ function toggleToc(this: HTMLElement) {
}
function setupToc() {
const toc = document.getElementById("toc")
if (toc) {
const buttons = document.querySelectorAll("button#toc") as NodeListOf<HTMLButtonElement>
for (const toc of buttons) {
const collapsed = toc.classList.contains("collapsed")
const content = toc.nextElementSibling as HTMLElement | undefined
if (!content) return