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});
},
applyChanges: function() {
this.disableControls(true);
return $.when.apply($, this.nodes.map(function(node) {
node.interfaces.each(function(ifc, index) {
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);
return Backbone.sync('update', interfaces, {url: _.result(node, 'url') + '/interfaces'});
}, this))
.fail(_.bind(function() {
utils.showErrorDialog({title: 'Interfaces configuration'});
}, this))
.always(_.bind(function() {
this.disableControls(false);
.done(_.bind(function(){
this.checkForChanges();
}, this))
.fail(_.bind(function() {
this.checkForChanges();
utils.showErrorDialog({title: 'Interfaces configuration'});
}, this));
},
setupButtonsBindings: function() {