diff --git a/chrome/content/zotero/integration/addCitationDialog.js b/chrome/content/zotero/integration/addCitationDialog.js index 4503e1ba5f..db25f5cab9 100644 --- a/chrome/content/zotero/integration/addCitationDialog.js +++ b/chrome/content/zotero/integration/addCitationDialog.js @@ -376,9 +376,9 @@ var Zotero_Citation_Dialog = new function () { this.add = Zotero.Promise.coroutine(function* (first_item) { var pos, len; - var item = itemsView.getSelectedItems()[0]; // treeview from xpcom/itemTreeView.js + var items = itemsView.getSelectedItems(); // treeview from xpcom/itemTreeView.js - if (!item) { + if (!items.length) { yield sortCitation(); _updateAccept(); _updatePreview(); @@ -386,9 +386,11 @@ var Zotero_Citation_Dialog = new function () { } // Add to selection list and generate a new itemDataID for this cite. - var selectionNode = _addItem(item); - var itemDataID = selectionNode.getAttribute("value"); - document.getElementById("add").disabled = !itemDataID; + for (let item of items) { + var selectionNode = _addItem(item); + var itemDataID = selectionNode.getAttribute("value"); + document.getElementById("add").disabled = !itemDataID; + } // Save existing locator and affix field content, if any. if (first_item) {