Allow processing hrefs in TOC asynchronously

This commit is contained in:
John Factotum
2023-10-08 20:42:47 +08:00
parent 819106c71f
commit 27a290ff59
3 changed files with 6 additions and 4 deletions
+2 -1
View File
@@ -91,7 +91,8 @@ export class View extends HTMLElement {
this.#sectionProgress = new SectionProgress(book.sections, 1500, 1600)
const splitHref = book.splitTOCHref.bind(book)
const getFragment = book.getTOCFragment.bind(book)
this.#tocProgress = new TOCProgress({
this.#tocProgress = new TOCProgress()
await this.#tocProgress.init({
toc: book.toc ?? [], ids, splitHref, getFragment })
this.#pageProgress = new TOCProgress({
toc: book.pageList ?? [], ids, splitHref, getFragment })