Browse Source

Added 'endreached' support.

if this is set to true, onLoadmore is not called further
master
Harish.K 11 years ago
parent
commit
acccb703fd
  1. 3
      src/JobManager.js

3
src/JobManager.js

@ -20,6 +20,7 @@ function JobManager(opts){
this.onLoadMore = null; this.onLoadMore = null;
this.onError = null; this.onError = null;
this.isLoadingTakingPlace = false; this.isLoadingTakingPlace = false;
this.endReached = false;
this.runningTasks = 0; this.runningTasks = 0;
} }
/* /*
@ -85,7 +86,7 @@ JobManager.prototype.$doWork_ = function( cb ){
self.onError(err, task, worker ); self.onError(err, task, worker );
} }
if(self.tasks.length/self.concurrency < self.notifyAt && (!self.isLoadingTakingPlace) ){ if(self.tasks.length/self.concurrency < self.notifyAt && (!self.isLoadingTakingPlace) ){
if( self.onLoadMore ) {
if( self.onLoadMore && !self.endReached ) {
self.$onLoadMore(); self.$onLoadMore();
} }
} }

Loading…
Cancel
Save