Merge "fixed always callback with disabling buttons"

This commit is contained in:
Jenkins 2013-10-31 13:45:19 +00:00 committed by Gerrit Code Review
commit eb40dd559b

View File

@ -1078,6 +1078,7 @@ function(utils, models, commonViews, dialogViews, nodesManagementPanelTemplate,
this.interfaces.reset(_.cloneDeep(this.nodes.at(0).interfaces.toJSON()), {parse: true}); this.interfaces.reset(_.cloneDeep(this.nodes.at(0).interfaces.toJSON()), {parse: true});
}, },
applyChanges: function() { applyChanges: function() {
this.disableControls(true);
return $.when.apply($, this.nodes.map(function(node) { return $.when.apply($, this.nodes.map(function(node) {
node.interfaces.each(function(ifc, index) { node.interfaces.each(function(ifc, index) {
ifc.set({assigned_networks: new models.InterfaceNetworks(this.interfaces.at(index).get('assigned_networks').toJSON())}); ifc.set({assigned_networks: new models.InterfaceNetworks(this.interfaces.at(index).get('assigned_networks').toJSON())});
@ -1090,12 +1091,12 @@ function(utils, models, commonViews, dialogViews, nodesManagementPanelTemplate,
}, this); }, this);
return Backbone.sync('update', interfaces, {url: _.result(node, 'url') + '/interfaces'}); return Backbone.sync('update', interfaces, {url: _.result(node, 'url') + '/interfaces'});
}, this)) }, this))
.fail(_.bind(function() { .done(_.bind(function(){
utils.showErrorDialog({title: 'Interfaces configuration'});
}, this))
.always(_.bind(function() {
this.disableControls(false);
this.checkForChanges(); this.checkForChanges();
}, this))
.fail(_.bind(function() {
this.checkForChanges();
utils.showErrorDialog({title: 'Interfaces configuration'});
}, this)); }, this));
}, },
setupButtonsBindings: function() { setupButtonsBindings: function() {