mirror of
https://github.com/zotero/zotero.git
synced 2026-10-03 02:21:49 +00:00
Citation Explorer: snapshot rows before async actions
This commit is contained in:
parent
80b82fc953
commit
ad90d4b76f
1 changed files with 4 additions and 3 deletions
|
|
@ -717,6 +717,10 @@ window.ZoteroCitationExplorer = {
|
|||
},
|
||||
|
||||
onItemRelink: async function () {
|
||||
let treeRow = itemList.getRow(itemList.selection.focused);
|
||||
if (!(treeRow instanceof CitationExplorerItemTreeRow) || treeRow.isLinked) return;
|
||||
let oldItemID = treeRow.id;
|
||||
|
||||
let io = { dataIn: null, dataOut: null, multiSelect: false, deferred: Zotero.Promise.defer() };
|
||||
window.openDialog('chrome://zotero/content/selectItemsDialog.xhtml', '',
|
||||
'chrome,dialog=no,centerscreen,resizable=yes', io);
|
||||
|
|
@ -730,9 +734,6 @@ window.ZoteroCitationExplorer = {
|
|||
if (!items.length) {
|
||||
return;
|
||||
}
|
||||
let treeRow = itemList.getRow(itemList.selection.focused);
|
||||
if (treeRow instanceof LibraryItemTreeRow) return;
|
||||
const oldItemID = treeRow.id;
|
||||
const itemIdx = itemRows.findIndex(row => row.id === oldItemID);
|
||||
this._linkItem(items[0], oldItemID, itemIdx);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue