Fix error generating context menu for multiple standalone attachments
Regression from f161d167ae
This commit is contained in:
parent
14caa3a895
commit
24104dc685
2 changed files with 11 additions and 0 deletions
|
@ -3075,6 +3075,7 @@ var ZoteroPane = new function()
|
|||
|
||||
|
||||
function attachmentsWithExtractableAnnotations(item) {
|
||||
if (!item.isRegularItem()) return [];
|
||||
return Zotero.Items.get(item.getAttachments())
|
||||
.filter(item => isAttachmentWithExtractableAnnotations(item));
|
||||
}
|
||||
|
|
|
@ -801,4 +801,14 @@ describe("ZoteroPane", function() {
|
|||
assert.lengthOf(Object.keys(conditions), 3);
|
||||
});
|
||||
});
|
||||
|
||||
describe("#buildItemContextMenu()", function () {
|
||||
it("should build menu for multiple standalone file attachments", async function () {
|
||||
var item1 = await importFileAttachment('test.png');
|
||||
var item2 = await importFileAttachment('test.png');
|
||||
|
||||
await zp.selectItems([item1.id, item2.id]);
|
||||
await zp.buildItemContextMenu();
|
||||
});
|
||||
});
|
||||
})
|
||||
|
|
Loading…
Add table
Reference in a new issue