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

Added windowBounds, enqueue checks after render

This commit is contained in:
Fred Chasen 2015-05-25 20:30:07 -04:00
parent b88aab25d9
commit f998e5be0a
4 changed files with 38 additions and 26 deletions

30
dist/epub.js vendored
View file

@ -2715,6 +2715,22 @@ EPUBJS.core.borders = function(el) {
width: width width: width
} }
};
EPUBJS.core.windowBounds = function() {
var width = window.innerWidth;
var height = window.innerHeight;
return {
top: 0,
left: 0,
right: width,
bottom: height,
width: width,
height: height
}
}; };
EPUBJS.Queue = function(_context){ EPUBJS.Queue = function(_context){
this._q = []; this._q = [];
@ -5605,18 +5621,8 @@ EPUBJS.Continuous.prototype.check = function(){
var checking = new RSVP.defer(); var checking = new RSVP.defer();
var container;//this.container.getBoundingClientRect(); var container;//this.container.getBoundingClientRect();
// Temp
if(!this.settings.height) { if(!this.settings.height) {
var width = window.innerWidth; container = EPUBJS.core.windowBounds();
var height = window.innerHeight;
container = {
top: 0,
left: 0,
right: width,
bottom: height,
width: width,
height: height
}
} else { } else {
container = this.container.getBoundingClientRect(); container = this.container.getBoundingClientRect();
} }
@ -5634,7 +5640,7 @@ EPUBJS.Continuous.prototype.check = function(){
.then(function(){ .then(function(){
// Check to see if anything new is on screen after rendering // Check to see if anything new is on screen after rendering
return this.check(); this.q.enqueue(this.check);
}.bind(this)); }.bind(this));
}); });

4
dist/epub.min.js vendored

File diff suppressed because one or more lines are too long

View file

@ -248,18 +248,8 @@ EPUBJS.Continuous.prototype.check = function(){
var checking = new RSVP.defer(); var checking = new RSVP.defer();
var container;//this.container.getBoundingClientRect(); var container;//this.container.getBoundingClientRect();
// Temp
if(!this.settings.height) { if(!this.settings.height) {
var width = window.innerWidth; container = EPUBJS.core.windowBounds();
var height = window.innerHeight;
container = {
top: 0,
left: 0,
right: width,
bottom: height,
width: width,
height: height
}
} else { } else {
container = this.container.getBoundingClientRect(); container = this.container.getBoundingClientRect();
} }
@ -277,7 +267,7 @@ EPUBJS.Continuous.prototype.check = function(){
.then(function(){ .then(function(){
// Check to see if anything new is on screen after rendering // Check to see if anything new is on screen after rendering
return this.check(); this.q.enqueue(this.check);
}.bind(this)); }.bind(this));
}); });

View file

@ -484,3 +484,19 @@ EPUBJS.core.borders = function(el) {
} }
}; };
EPUBJS.core.windowBounds = function() {
var width = window.innerWidth;
var height = window.innerHeight;
return {
top: 0,
left: 0,
right: width,
bottom: height,
width: width,
height: height
}
};