Allow adding multiple sources at once in classic citation dialog.

Closes #2568
This commit is contained in:
Adomas Venčkauskas 2022-04-25 13:28:00 +03:00
parent 1be2d69f1e
commit d96ebad82a

View file

@ -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) {