mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-03 14:59:18 +02:00
Only trim after destroy, no trim timeout
This commit is contained in:
parent
812be32e71
commit
42efc34517
4 changed files with 24 additions and 22 deletions
19
dist/epub.js
vendored
19
dist/epub.js
vendored
|
@ -4577,9 +4577,9 @@ EPUBJS.View.prototype.resized = function(e) {
|
|||
|
||||
EPUBJS.View.prototype.display = function(_request) {
|
||||
|
||||
if(this.rendering){
|
||||
return this.displayed;
|
||||
}
|
||||
// if(this.rendering){
|
||||
// return this.displayed;
|
||||
// }
|
||||
|
||||
this.rendering = true;
|
||||
this.displaying = new RSVP.defer();
|
||||
|
@ -5597,7 +5597,6 @@ EPUBJS.Continuous.prototype.append = function(view){
|
|||
this.views.push(view);
|
||||
this.container.appendChild(view.element);
|
||||
|
||||
|
||||
// view.on("shown", this.afterDisplayed.bind(this));
|
||||
view.onShown = this.afterDisplayed.bind(this);
|
||||
|
||||
|
@ -5714,29 +5713,31 @@ EPUBJS.Continuous.prototype.check = function(){
|
|||
if(visible) {
|
||||
|
||||
if(!view.shown && !view.rendering) {
|
||||
// console.log("render",view.section.index)
|
||||
promises.push(this.render(view));
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if(view.shown) {
|
||||
// console.log("destroy", view.section.index)
|
||||
view.destroy();
|
||||
this.q.enqueue(this.trim);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}.bind(this));
|
||||
|
||||
clearTimeout(this.trimTimeout);
|
||||
this.trimTimeout = setTimeout(function(){
|
||||
this.q.enqueue(this.trim);
|
||||
}.bind(this), 250);
|
||||
// clearTimeout(this.trimTimeout);
|
||||
// this.trimTimeout = setTimeout(function(){
|
||||
// this.q.enqueue(this.trim);
|
||||
// }.bind(this), 250);
|
||||
|
||||
if(promises.length){
|
||||
|
||||
return RSVP.all(promises)
|
||||
.then(function(posts) {
|
||||
|
||||
// Check to see if anything new is on screen after rendering
|
||||
this.q.enqueue(this.check);
|
||||
|
||||
|
|
4
dist/epub.min.js
vendored
4
dist/epub.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -126,7 +126,6 @@ EPUBJS.Continuous.prototype.append = function(view){
|
|||
this.views.push(view);
|
||||
this.container.appendChild(view.element);
|
||||
|
||||
|
||||
// view.on("shown", this.afterDisplayed.bind(this));
|
||||
view.onShown = this.afterDisplayed.bind(this);
|
||||
|
||||
|
@ -243,29 +242,31 @@ EPUBJS.Continuous.prototype.check = function(){
|
|||
if(visible) {
|
||||
|
||||
if(!view.shown && !view.rendering) {
|
||||
// console.log("render",view.section.index)
|
||||
promises.push(this.render(view));
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if(view.shown) {
|
||||
// console.log("destroy", view.section.index)
|
||||
view.destroy();
|
||||
this.q.enqueue(this.trim);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}.bind(this));
|
||||
|
||||
clearTimeout(this.trimTimeout);
|
||||
this.trimTimeout = setTimeout(function(){
|
||||
this.q.enqueue(this.trim);
|
||||
}.bind(this), 250);
|
||||
// clearTimeout(this.trimTimeout);
|
||||
// this.trimTimeout = setTimeout(function(){
|
||||
// this.q.enqueue(this.trim);
|
||||
// }.bind(this), 250);
|
||||
|
||||
if(promises.length){
|
||||
|
||||
return RSVP.all(promises)
|
||||
.then(function(posts) {
|
||||
|
||||
// Check to see if anything new is on screen after rendering
|
||||
this.q.enqueue(this.check);
|
||||
|
||||
|
|
|
@ -176,9 +176,9 @@ EPUBJS.View.prototype.resized = function(e) {
|
|||
|
||||
EPUBJS.View.prototype.display = function(_request) {
|
||||
|
||||
if(this.rendering){
|
||||
return this.displayed;
|
||||
}
|
||||
// if(this.rendering){
|
||||
// return this.displayed;
|
||||
// }
|
||||
|
||||
this.rendering = true;
|
||||
this.displaying = new RSVP.defer();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue