1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-04 15:09:16 +02:00

Destroy contents when removing view

This commit is contained in:
Fred Chasen 2018-12-06 08:42:22 -08:00
parent 35d7953b29
commit 4728d09b1d
3 changed files with 2 additions and 2 deletions

View file

@ -33,7 +33,7 @@
rendition.display(currentSectionIndex); rendition.display(currentSectionIndex);
book.ready.then(() => { book.ready.then(function() {
var next = document.getElementById("next"); var next = document.getElementById("next");

View file

@ -450,7 +450,6 @@ class Contents {
clearTimeout(this.expanding); clearTimeout(this.expanding);
requestAnimationFrame(this.resizeCheck.bind(this)); requestAnimationFrame(this.resizeCheck.bind(this));
this.expanding = setTimeout(this.resizeListeners.bind(this), 350); this.expanding = setTimeout(this.resizeListeners.bind(this), 350);
} }

View file

@ -780,6 +780,7 @@ class IframeView {
this.displayed = false; this.displayed = false;
this.removeListeners(); this.removeListeners();
this.contents.destroy();
this.stopExpanding = true; this.stopExpanding = true;
this.element.removeChild(this.iframe); this.element.removeChild(this.iframe);