mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-10-24 22:59:51 -04:00
Paginator: destroy view before removing it
This commit is contained in:
1 parent
18159a4d07
commit
b0d7ed481f
1 file changed
+4
-1
+4
-1
@@ -533,7 +533,10 @@ export class Paginator extends HTMLElement {
|
|||||||
this.sections = book.sections
|
this.sections = book.sections
|
||||||
}
|
}
|
||||||
#createView() {
|
#createView() {
|
||||||
if (this.#view) this.#container.removeChild(this.#view.element)
|
if (this.#view) {
|
||||||
|
this.#view.destroy()
|
||||||
|
this.#container.removeChild(this.#view.element)
|
||||||
|
}
|
||||||
this.#view = new View({
|
this.#view = new View({
|
||||||
container: this,
|
container: this,
|
||||||
onExpand: () => this.scrollToAnchor(this.#anchor),
|
onExpand: () => this.scrollToAnchor(this.#anchor),
|
||||||
|
|||||||
Reference in new issue
Block a user