mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-04 15:09:16 +02:00
merged, linted
This commit is contained in:
commit
0013cf417d
10 changed files with 68 additions and 40 deletions
|
@ -173,9 +173,13 @@ EPUBJS.Renderer.prototype.attachTo = function(_element){
|
|||
this.infinite.on("forwards", function(){
|
||||
var next = this.last().section.index + 1;
|
||||
|
||||
if(!this.rendering && !this.filling && !this.displaying
|
||||
&& next < this.book.spine.length){
|
||||
if(!this.rendering &&
|
||||
!this.filling &&
|
||||
!this.displaying &&
|
||||
next < this.book.spine.length){
|
||||
|
||||
this.forwards();
|
||||
|
||||
}
|
||||
|
||||
}.bind(this));
|
||||
|
@ -183,9 +187,13 @@ EPUBJS.Renderer.prototype.attachTo = function(_element){
|
|||
this.infinite.on("backwards", function(){
|
||||
var prev = this.first().section.index - 1;
|
||||
|
||||
if(!this.rendering && !this.filling && !this.displaying
|
||||
&& prev > 0){
|
||||
if(!this.rendering &&
|
||||
!this.filling &&
|
||||
!this.displaying &&
|
||||
prev > 0){
|
||||
|
||||
this.backwards();
|
||||
|
||||
}
|
||||
|
||||
}.bind(this));
|
||||
|
@ -260,7 +268,7 @@ EPUBJS.Renderer.prototype.render = function(section){
|
|||
right: parseFloat(styles["padding-right"]) || 0,
|
||||
top: parseFloat(styles["padding-top"]) || 0,
|
||||
bottom: parseFloat(styles["padding-bottom"]) || 0
|
||||
};
|
||||
};
|
||||
var width = bounds.width - padding.left - padding.right;
|
||||
var height = bounds.height - padding.top - padding.bottom;
|
||||
|
||||
|
@ -269,7 +277,7 @@ EPUBJS.Renderer.prototype.render = function(section){
|
|||
rendered = new RSVP.defer();
|
||||
rendered.reject(new Error("No Section Provided"));
|
||||
return rendered.promise;
|
||||
};
|
||||
}
|
||||
|
||||
view = new EPUBJS.View(section);
|
||||
|
||||
|
@ -319,7 +327,7 @@ EPUBJS.Renderer.prototype.forwards = function(){
|
|||
rendered.reject(new Error("Reject Forwards"));
|
||||
return rendered.promise;
|
||||
}
|
||||
console.log("going forwards")
|
||||
// console.log("going forwards")
|
||||
|
||||
this.rendering = true;
|
||||
|
||||
|
@ -375,7 +383,7 @@ EPUBJS.Renderer.prototype.backwards = function(view){
|
|||
rendered.reject(new Error("Reject Backwards"));
|
||||
return rendered.promise;
|
||||
}
|
||||
console.log("going backwards")
|
||||
// console.log("going backwards")
|
||||
|
||||
this.rendering = true;
|
||||
|
||||
|
@ -557,7 +565,7 @@ EPUBJS.Renderer.prototype.replacements = function(view, renderer) {
|
|||
|
||||
for (var i = 0; i < links.length; i++) {
|
||||
replaceLinks(links[i]);
|
||||
};
|
||||
}
|
||||
|
||||
task.resolve();
|
||||
return task.promise;
|
||||
|
@ -601,10 +609,10 @@ EPUBJS.Renderer.prototype.checkCurrent = function(position) {
|
|||
}
|
||||
|
||||
this.current = view.section;
|
||||
this.trigger("current", this.current)
|
||||
this.trigger("current", this.current);
|
||||
break;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue