diff --git a/chrome/content/zotero/bindings/itembox.xml b/chrome/content/zotero/bindings/itembox.xml index d763c9297..34538c8ac 100644 --- a/chrome/content/zotero/bindings/itembox.xml +++ b/chrome/content/zotero/bindings/itembox.xml @@ -1422,13 +1422,25 @@ || fieldName == 'creator') { t.setAttribute('type', 'autocomplete'); t.setAttribute('autocompletesearch', 'zotero'); - let params = { + + var params = { fieldName: fieldName, libraryID: this.item.libraryID }; if (field == 'creator') { params.fieldMode = parseInt(elem.getAttribute('fieldMode')); - params.itemID = itemID ? itemID : ''; + + // Include itemID and creatorTypeID so the autocomplete can + // avoid showing results for creators already set on the item + var row = Zotero.getAncestorByTagName(elem, 'row'); + var creatorTypeID = parseInt( + row.getElementsByClassName('creator-type-label')[0] + .getAttribute('typeid') + ); + if (itemID) { + params.itemID = itemID; + params.creatorTypeID = creatorTypeID; + } }; t.setAttribute( 'autocompletesearchparam', JSON.stringify(params) @@ -2163,6 +2175,25 @@ + + + + + + + + +