Fix #1600 Can not save a deleted field in admin field app

This commit is contained in:
Nicolas Le Goff
2013-11-28 11:08:42 +01:00
parent 5504f9013a
commit afde85140f
2 changed files with 5 additions and 3 deletions

View File

@@ -195,7 +195,8 @@ define([
AdminFieldApp.fieldsToDelete.push(self.model); AdminFieldApp.fieldsToDelete.push(self.model);
AdminFieldApp.fieldListView.collection.remove(self.model); AdminFieldApp.fieldListView.collection.remove(self.model);
self._selectModelView(index); self._selectModelView(index);
AdminFieldApp.saveView.updateStateButton(); // Enable state button, models is out of sync
AdminFieldApp.saveView.updateStateButton(false);
}); });
return this; return this;

View File

@@ -84,8 +84,9 @@ define([
return this; return this;
}, },
updateStateButton: function () { updateStateButton: function (disable) {
this._disableSaveButton(!this._isModelDesync()); var toDisable = disable || !this._isModelDesync();
this._disableSaveButton(toDisable);
}, },
// check whether model has changed or not // check whether model has changed or not
_isModelDesync: function () { _isModelDesync: function () {