Refactored project structure

This commit is contained in:
squidfunk
2021-11-14 16:09:09 +01:00
parent ad1b964aaa
commit 88ba609ee1
52 changed files with 721 additions and 459 deletions

View File

@@ -48,9 +48,9 @@ import {
} from "~/actions"
import {
Viewport,
getElement,
getElements,
getLocation,
getOptionalElement,
watchElementSize
} from "~/browser"
@@ -122,7 +122,7 @@ export function watchTableOfContents(
const anchors = getElements<HTMLAnchorElement>("[href^=\\#]", el)
for (const anchor of anchors) {
const id = decodeURIComponent(anchor.hash.substring(1))
const target = getElement(`[id="${id}"]`)
const target = getOptionalElement(`[id="${id}"]`)
if (typeof target !== "undefined")
table.set(anchor, target)
}