Don't mark item as changed if setField('') is called on an empty field (i.e. prevent unnecessary save() calls)

This commit is contained in:
Dan Stillman 2006-06-08 21:08:50 +00:00
parent 3715f2c89e
commit c3acdf04a6

View file

@ -333,7 +333,8 @@ Scholar.Item.prototype.setField = function(field, value, loadIn){
}
// If existing value, make sure it's actually changing
if (this._itemData[fieldID] && this._itemData[fieldID]==value){
if ((!this._itemData[fieldID] && !value) ||
(this._itemData[fieldID] && this._itemData[fieldID]==value)){
return false;
}
this._itemData[fieldID] = value;