mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-09-09 11:29:14 -04:00
Paginator: destroy view before removing it
This commit is contained in:
+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