mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-10-24 22:59:51 -04:00
Unload section when destroying the renderer
This commit is contained in:
1 parent
14067fe683
commit
2e5dda77e0
2 files changed
+17
-5
No files matched your search
@@ -129,6 +129,15 @@ export class View extends HTMLElement {
|
||||
this.renderer.open(book)
|
||||
this.#root.append(this.renderer)
|
||||
}
|
||||
close() {
|
||||
this.renderer?.destroy?.()
|
||||
this.#sectionProgress = null
|
||||
this.#tocProgress = null
|
||||
this.#pageProgress = null
|
||||
this.#searchResults = new Map()
|
||||
this.lastLocation = null
|
||||
this.history = new History()
|
||||
}
|
||||
goToTextStart() {
|
||||
return this.goTo(this.book.landmarks
|
||||
?.find(m => m.type.includes('bodymatter') || m.type.includes('text'))
|
||||
@@ -392,10 +401,6 @@ export class View extends HTMLElement {
|
||||
for (const item of list) this.deleteAnnotation(item)
|
||||
this.#searchResults.clear()
|
||||
}
|
||||
destroy() {
|
||||
this.book.destroy?.()
|
||||
this.renderer?.destroy?.()
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define('foliate-view', View)
|
||||
Reference in new issue
Block a user