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:
parent
3715f2c89e
commit
c3acdf04a6
1 changed files with 2 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue