1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-03 14:59:18 +02:00

Add Destroy to view managers

This commit is contained in:
Fred Chasen 2017-02-12 13:27:49 -05:00
parent db727b00a9
commit d95ec97f7f
10 changed files with 118 additions and 59 deletions

View file

@ -221,6 +221,9 @@ class Rendition {
* @return {Promise}
*/
_display(target){
if (!this.book) {
return;
}
var isCfiString = this.epubcfi.isCfiString(target);
var displaying = new defer();
var displayed = displaying.promise;
@ -513,30 +516,32 @@ class Rendition {
*/
destroy(){
// Clear the queue
this.q.clear();
this.q = undefined;
// this.q.clear();
// this.q = undefined;
this.book = book;
this.manager && this.manager.destroy();
this.book = undefined;
this.views = null;
this.hooks.display.clear();
this.hooks.serialize.clear();
this.hooks.content.clear();
this.hooks.layout.clear();
this.hooks.render.clear();
this.hooks.show.clear();
this.hooks = {};
// this.hooks.display.clear();
// this.hooks.serialize.clear();
// this.hooks.content.clear();
// this.hooks.layout.clear();
// this.hooks.render.clear();
// this.hooks.show.clear();
// this.hooks = {};
this.themes.destroy();
this.themes = undefined;
this.epubcfi = undefined;
// this.themes.destroy();
// this.themes = undefined;
// this.epubcfi = undefined;
// this.starting = undefined;
// this.started = undefined;
this.starting = undefined;
this.started = undefined;
this.manager && this.manager.destroy();
}
/**