mirror of
https://github.com/harish2704/node-job-manager.git
synced 2026-09-10 13:11:08 +00:00
Fix: no need to assign tasks before initial start of JobManager. tasks are loaded using onLoadmore at start time
This commit is contained in:
+10
-2
@@ -110,14 +110,22 @@ JobManager.prototype.$trigger = function (){
|
|||||||
JobManager.prototype.start = function( ) {
|
JobManager.prototype.start = function( ) {
|
||||||
this.state = STATE.RUNNING;
|
this.state = STATE.RUNNING;
|
||||||
this.updateState();
|
this.updateState();
|
||||||
this.$trigger();
|
var self = this;
|
||||||
|
if( this.tasks.length ) {
|
||||||
|
return this.$trigger();
|
||||||
|
}
|
||||||
|
return this.$onLoadMore( function(){
|
||||||
|
self.$trigger();
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
JobManager.prototype.$onLoadMore = function(){
|
JobManager.prototype.$onLoadMore = function( cb ){
|
||||||
|
cb = cb || function(){};
|
||||||
var self = this;
|
var self = this;
|
||||||
self.isLoadingTakingPlace = true;
|
self.isLoadingTakingPlace = true;
|
||||||
self.onLoadMore(function(){
|
self.onLoadMore(function(){
|
||||||
self.isLoadingTakingPlace = false;
|
self.isLoadingTakingPlace = false;
|
||||||
|
return cb();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user