Command queue

New: Adding multiple series will queue them instead of running all at once
New: Slower scheduled tasks won't be block others from running
This commit is contained in:
Mark McDowall
2015-01-15 16:30:09 -08:00
parent 446d470f53
commit 638e3ca898
66 changed files with 1151 additions and 636 deletions

View File

@@ -74,7 +74,7 @@ var singleton = function() {
return;
}
model.bind('change:state', function(model) {
model.bind('change:status', function(model) {
if (!model.isActive()) {
options.element.stopSpin();

View File

@@ -6,6 +6,14 @@ module.exports = Backbone.Model.extend({
parse : function(response) {
response.name = response.name.toLocaleLowerCase();
response.body.name = response.body.name.toLocaleLowerCase();
for (var key in response.body) {
response[key] = response.body[key];
}
delete response.body;
return response;
},
@@ -33,10 +41,10 @@ module.exports = Backbone.Model.extend({
},
isActive : function() {
return this.get('state') !== 'completed' && this.get('state') !== 'failed';
return this.get('status') !== 'completed' && this.get('status') !== 'failed';
},
isComplete : function() {
return this.get('state') === 'completed';
return this.get('status') === 'completed';
}
});