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:
parent
b88aab25d9
commit
f998e5be0a
4 changed files with 38 additions and 26 deletions
30
dist/epub.js
vendored
30
dist/epub.js
vendored
|
@ -2715,6 +2715,22 @@ EPUBJS.core.borders = function(el) {
|
|||
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){
|
||||
this._q = [];
|
||||
|
@ -5605,18 +5621,8 @@ EPUBJS.Continuous.prototype.check = function(){
|
|||
var checking = new RSVP.defer();
|
||||
var container;//this.container.getBoundingClientRect();
|
||||
|
||||
// Temp
|
||||
if(!this.settings.height) {
|
||||
var width = window.innerWidth;
|
||||
var height = window.innerHeight;
|
||||
container = {
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: width,
|
||||
bottom: height,
|
||||
width: width,
|
||||
height: height
|
||||
}
|
||||
container = EPUBJS.core.windowBounds();
|
||||
} else {
|
||||
container = this.container.getBoundingClientRect();
|
||||
}
|
||||
|
@ -5634,7 +5640,7 @@ EPUBJS.Continuous.prototype.check = function(){
|
|||
.then(function(){
|
||||
|
||||
// Check to see if anything new is on screen after rendering
|
||||
return this.check();
|
||||
this.q.enqueue(this.check);
|
||||
|
||||
}.bind(this));
|
||||
});
|
||||
|
|
4
dist/epub.min.js
vendored
4
dist/epub.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -248,18 +248,8 @@ EPUBJS.Continuous.prototype.check = function(){
|
|||
var checking = new RSVP.defer();
|
||||
var container;//this.container.getBoundingClientRect();
|
||||
|
||||
// Temp
|
||||
if(!this.settings.height) {
|
||||
var width = window.innerWidth;
|
||||
var height = window.innerHeight;
|
||||
container = {
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: width,
|
||||
bottom: height,
|
||||
width: width,
|
||||
height: height
|
||||
}
|
||||
container = EPUBJS.core.windowBounds();
|
||||
} else {
|
||||
container = this.container.getBoundingClientRect();
|
||||
}
|
||||
|
@ -277,7 +267,7 @@ EPUBJS.Continuous.prototype.check = function(){
|
|||
.then(function(){
|
||||
|
||||
// Check to see if anything new is on screen after rendering
|
||||
return this.check();
|
||||
this.q.enqueue(this.check);
|
||||
|
||||
}.bind(this));
|
||||
});
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue