From c3acdf04a6e2de57d39589a23dc81c8d8186d176 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 8 Jun 2006 21:08:50 +0000 Subject: [PATCH] Don't mark item as changed if setField('') is called on an empty field (i.e. prevent unnecessary save() calls) --- chrome/chromeFiles/content/scholar/xpcom/data_access.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chrome/chromeFiles/content/scholar/xpcom/data_access.js b/chrome/chromeFiles/content/scholar/xpcom/data_access.js index d5311beca..2897e78c5 100644 --- a/chrome/chromeFiles/content/scholar/xpcom/data_access.js +++ b/chrome/chromeFiles/content/scholar/xpcom/data_access.js @@ -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;