From fcb30b5e5d76a601be766cf3507c810e3efc044a Mon Sep 17 00:00:00 2001 From: Martynas Bagdonas Date: Fri, 30 Jun 2023 10:52:25 +0300 Subject: [PATCH] Fix not working context menu options to create note from annotations --- chrome/content/zotero/zoteroPane.js | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index 35763e60bf..85166a0614 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -3346,16 +3346,12 @@ var ZoteroPane = new function() // If all from a single item, show "Add Note from Annotations" if (Zotero.Items.getTopLevel(items).length == 1) { key = 'addNoteFromAnnotations'; - menuitem.onclick = async () => { - return this.addNoteFromAnnotationsFromSelected(); - }; + menuitem.setAttribute('oncommand', 'ZoteroPane.addNoteFromAnnotationsFromSelected()'); } // Otherwise show "Create Note from Annotations" else { key = 'createNoteFromAnnotations'; - menuitem.onclick = async () => { - return this.createStandaloneNoteFromAnnotationsFromSelected(); - }; + menuitem.setAttribute('oncommand', 'ZoteroPane.createStandaloneNoteFromAnnotationsFromSelected()'); } menuitem.setAttribute( 'label', @@ -3443,16 +3439,12 @@ var ZoteroPane = new function() // Show "Create" on standalone attachments if (item.isAttachment() && item.isTopLevelItem()) { str = 'pane.items.menu.createNoteFromAnnotations'; - menuitem.onclick = async () => { - return this.createStandaloneNoteFromAnnotationsFromSelected(); - }; + menuitem.setAttribute('oncommand', 'ZoteroPane.createStandaloneNoteFromAnnotationsFromSelected()'); } // And "Add" otherwise else { str = 'pane.items.menu.addNoteFromAnnotations'; - menuitem.onclick = async () => { - return this.addNoteFromAnnotationsFromSelected(); - }; + menuitem.setAttribute('oncommand', 'ZoteroPane.addNoteFromAnnotationsFromSelected()'); } menuitem.setAttribute('label', Zotero.getString(str)); }