fixed always callback with disabling buttons

Change-Id: Ib7ac171d8e0e5d395ade52cd2cabc20f8ac1855f
This commit is contained in:
astepanchuk 2013-10-31 13:28:38 +02:00
parent 9899c6e7bb
commit c1da96d9be

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() {