commit 47b765121fea0c531802db45c37809dcd901c4fa
parent 7cee5b3b60381a96c7250c8a18b649d374d08708
Author: Dan Stillman <dstillman@zotero.org>
Date: Wed, 4 Oct 2006 03:00:10 +0000
Restore original value in metadata fields when hitting Esc (I think it used to do this correctly and I broke it at some point)
Don't try to convert accessDate if it's blank
Restore autocomplete on tags
Diffstat:
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/chrome/content/zotero/itemPane.js b/chrome/content/zotero/itemPane.js
@@ -655,8 +655,11 @@ var ZoteroItemPane = new function()
case 'dateAdded':
case 'dateModified':
case 'accessDate':
- var date = Zotero.Date.sqlToDate(valueText, true);
- valueText = date ? date.toLocaleString() : '';
+ if (valueText)
+ {
+ var date = Zotero.Date.sqlToDate(valueText, true);
+ valueText = date ? date.toLocaleString() : '';
+ }
break;
}
}
@@ -735,7 +738,7 @@ var ZoteroItemPane = new function()
var itemID = _itemBeingEdited.getID();
// Access date needs to be converted from UTC
- if (fieldName=='accessDate')
+ if (fieldName=='accessDate' && value!='')
{
var localDate = Zotero.Date.sqlToDate(value, true);
var value = Zotero.Date.dateToSQL(localDate);
@@ -770,6 +773,7 @@ var ZoteroItemPane = new function()
case 'journalAbbreviation':
case 'seriesTitle':
case 'seriesText':
+ case 'tag':
// DEBUG: should have type and medium, but they need to be
// broken out first into multiple fields (artworkType,
// interviewMedium, etc.)
@@ -860,6 +864,8 @@ var ZoteroItemPane = new function()
return false;
case event.DOM_VK_ESCAPE:
+ // Reset field to original value
+ target.value = target.getAttribute('value');
target.blur();
return false;
@@ -999,7 +1005,7 @@ var ZoteroItemPane = new function()
else
{
// Access date needs to be converted to UTC
- if (fieldName=='accessDate')
+ if (fieldName=='accessDate' && value!='')
{
var localDate = Zotero.Date.sqlToDate(value);
var value = Zotero.Date.dateToSQL(localDate, true);