diff --git a/chrome/content/zotero/itemPane.js b/chrome/content/zotero/itemPane.js index ec7de6c9c..6d2a5e806 100644 --- a/chrome/content/zotero/itemPane.js +++ b/chrome/content/zotero/itemPane.js @@ -488,7 +488,7 @@ var ZoteroItemPane = new function() firstlast.setAttribute("flex","1"); var tabindex = _tabIndexMinCreators + (_creatorCount * 2); - firstlast.appendChild( + var lastNameLabel = firstlast.appendChild( createValueElement( lastName, 'creator-' + _creatorCount + '-lastName', @@ -563,6 +563,11 @@ var ZoteroItemPane = new function() { switchCreatorMode(hbox.parentNode, false, true); } + + // Focus new rows + if (unsaved && !defaultRow){ + lastNameLabel.click(); + } } function switchCreatorMode(row, singleField, initial) @@ -878,9 +883,23 @@ var ZoteroItemPane = new function() var creator = Zotero.Creators.get(creatorID); + var otherField = creatorField=='lastName' ? 'firstName' : 'lastName'; + + // Update this textbox + textbox.setAttribute('value', creator[creatorField]); + textbox.value = creator[creatorField]; + + // Update the other label + if (otherField=='firstName'){ + var label = textbox.nextSibling.nextSibling; + } + else if (otherField=='lastName'){ + var label = textbox.previousSibling.previousSibling; + } + label.firstChild.nodeValue = creator[otherField]; + var row = textbox.parentNode.parentNode.parentNode; var otherFields = ZoteroItemPane.getCreatorFields(row); - var otherField = creatorField=='lastName' ? 'firstName' : 'lastName'; otherFields[otherField] = creator[otherField]; ZoteroItemPane.modifyCreator(creatorIndex, creatorField,