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

corrected load order for view

This commit is contained in:
Fred Chasen 2014-08-06 17:48:24 -07:00
parent a8bdd2d042
commit 87bd3a68ad
5 changed files with 18 additions and 16 deletions

View file

@ -12,17 +12,12 @@ EPUBJS.View.prototype.load = function(contents) {
var loaded = loading.promise;
this.document = this.iframe.contentDocument;
// this.iframe.srcdoc = contents;
this.document.open();
this.document.write(contents);
this.document.close();
this.iframe.onload = function(e) {
this.window = this.iframe.contentWindow;
this.window.addEventListener("resize", this.resized.bind(this), false);
this.document = this.iframe.contentDocument;
this.iframe.style.display = "block";
// Reset Body Styles
@ -39,6 +34,11 @@ EPUBJS.View.prototype.load = function(contents) {
loading.resolve(this);
this.loading.resolve(this);
}.bind(this);
// this.iframe.srcdoc = contents;
this.document.open();
this.document.write(contents);
this.document.close();
return loaded;
};