Open gimox opened 7 years ago
Sometime loading multiple book can generate error because iframe is not correctly removed.
EPUBJS.Renderer.prototype.remove = function() { if(this.render.window) { this.render.unload(); this.render.window.removeEventListener("resize", this.resized); this.removeEventListeners(); this.removeSelectionListeners(); } // clean container content this.container.innerHtml = ""; // this.container.removeChild(this.element); };
the issue is on cleaning container instead of remove it.
My proposal is for re-add/uncomment removeChild that is always safe.
EPUBJS.Renderer.prototype.remove = function() { if(this.render.window) { this.render.unload(); this.render.window.removeEventListener("resize", this.resized); this.removeEventListeners(); this.removeSelectionListeners(); } // clean container content //this.container.innerHtml = ""; this.container.removeChild(this.element); };
That sounds like a good solution, not sure why the innerHtml ended up there.
A PR with that change would be very appreciated.
Sometime loading multiple book can generate error because iframe is not correctly removed.
the issue is on cleaning container instead of remove it.
My proposal is for re-add/uncomment removeChild that is always safe.