mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-05 15:32:55 +02:00
corrected load order for view
This commit is contained in:
parent
a8bdd2d042
commit
87bd3a68ad
5 changed files with 18 additions and 16 deletions
15
dist/epub.js
vendored
15
dist/epub.js
vendored
|
@ -4401,6 +4401,7 @@ EPUBJS.SpineItem.prototype.load = function(_request){
|
|||
request(this.url, 'xml').then(function(xml){
|
||||
var base;
|
||||
var directory = EPUBJS.core.folder(this.url);
|
||||
|
||||
this.document = xml;
|
||||
this.contents = xml.documentElement;
|
||||
|
||||
|
@ -4449,17 +4450,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
|
||||
|
@ -4476,6 +4472,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;
|
||||
};
|
||||
|
|
2
dist/epub.min.js
vendored
2
dist/epub.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -66,7 +66,7 @@
|
|||
var $prev = document.getElementById("prev");
|
||||
var currentSectionIndex = 10;
|
||||
// Load the opf
|
||||
var book = ePub("../books/moby-dick/OPS/package.opf");
|
||||
var book = ePub("https://s3.amazonaws.com/moby-dick/OPS/package.opf");
|
||||
var rendition = book.renderTo("viewer", {width: 600, height: 400});
|
||||
var displayed = rendition.display(currentSectionIndex);
|
||||
|
||||
|
|
|
@ -73,6 +73,7 @@ EPUBJS.SpineItem.prototype.load = function(_request){
|
|||
request(this.url, 'xml').then(function(xml){
|
||||
var base;
|
||||
var directory = EPUBJS.core.folder(this.url);
|
||||
|
||||
this.document = xml;
|
||||
this.contents = xml.documentElement;
|
||||
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue