From acccb703fdfb3b252da41dc5a09fe0fcd25fe715 Mon Sep 17 00:00:00 2001 From: "Harish.K" Date: Mon, 22 Sep 2014 15:28:44 +0530 Subject: [PATCH] Added 'endreached' support. if this is set to true, onLoadmore is not called further --- src/JobManager.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/JobManager.js b/src/JobManager.js index 01b1fd4..f7c7651 100644 --- a/src/JobManager.js +++ b/src/JobManager.js @@ -20,6 +20,7 @@ function JobManager(opts){ this.onLoadMore = null; this.onError = null; this.isLoadingTakingPlace = false; + this.endReached = false; this.runningTasks = 0; } /* @@ -85,7 +86,7 @@ JobManager.prototype.$doWork_ = function( cb ){ self.onError(err, task, worker ); } if(self.tasks.length/self.concurrency < self.notifyAt && (!self.isLoadingTakingPlace) ){ - if( self.onLoadMore ) { + if( self.onLoadMore && !self.endReached ) { self.$onLoadMore(); } }