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
This commit is contained in:
parent
7cee5b3b60
commit
47b765121f
1 changed files with 10 additions and 4 deletions
|
@ -655,8 +655,11 @@ var ZoteroItemPane = new function()
|
||||||
case 'dateAdded':
|
case 'dateAdded':
|
||||||
case 'dateModified':
|
case 'dateModified':
|
||||||
case 'accessDate':
|
case 'accessDate':
|
||||||
|
if (valueText)
|
||||||
|
{
|
||||||
var date = Zotero.Date.sqlToDate(valueText, true);
|
var date = Zotero.Date.sqlToDate(valueText, true);
|
||||||
valueText = date ? date.toLocaleString() : '';
|
valueText = date ? date.toLocaleString() : '';
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -735,7 +738,7 @@ var ZoteroItemPane = new function()
|
||||||
var itemID = _itemBeingEdited.getID();
|
var itemID = _itemBeingEdited.getID();
|
||||||
|
|
||||||
// Access date needs to be converted from UTC
|
// Access date needs to be converted from UTC
|
||||||
if (fieldName=='accessDate')
|
if (fieldName=='accessDate' && value!='')
|
||||||
{
|
{
|
||||||
var localDate = Zotero.Date.sqlToDate(value, true);
|
var localDate = Zotero.Date.sqlToDate(value, true);
|
||||||
var value = Zotero.Date.dateToSQL(localDate);
|
var value = Zotero.Date.dateToSQL(localDate);
|
||||||
|
@ -770,6 +773,7 @@ var ZoteroItemPane = new function()
|
||||||
case 'journalAbbreviation':
|
case 'journalAbbreviation':
|
||||||
case 'seriesTitle':
|
case 'seriesTitle':
|
||||||
case 'seriesText':
|
case 'seriesText':
|
||||||
|
case 'tag':
|
||||||
// DEBUG: should have type and medium, but they need to be
|
// DEBUG: should have type and medium, but they need to be
|
||||||
// broken out first into multiple fields (artworkType,
|
// broken out first into multiple fields (artworkType,
|
||||||
// interviewMedium, etc.)
|
// interviewMedium, etc.)
|
||||||
|
@ -860,6 +864,8 @@ var ZoteroItemPane = new function()
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
case event.DOM_VK_ESCAPE:
|
case event.DOM_VK_ESCAPE:
|
||||||
|
// Reset field to original value
|
||||||
|
target.value = target.getAttribute('value');
|
||||||
target.blur();
|
target.blur();
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -999,7 +1005,7 @@ var ZoteroItemPane = new function()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Access date needs to be converted to UTC
|
// Access date needs to be converted to UTC
|
||||||
if (fieldName=='accessDate')
|
if (fieldName=='accessDate' && value!='')
|
||||||
{
|
{
|
||||||
var localDate = Zotero.Date.sqlToDate(value);
|
var localDate = Zotero.Date.sqlToDate(value);
|
||||||
var value = Zotero.Date.dateToSQL(localDate, true);
|
var value = Zotero.Date.dateToSQL(localDate, true);
|
||||||
|
|
Loading…
Reference in a new issue