From 338d753eb3c03ef415eb95b611a9aec2a72c7a75 Mon Sep 17 00:00:00 2001 From: Martynas Bagdonas Date: Mon, 13 Dec 2021 16:36:47 +0200 Subject: [PATCH] Fix itemBox opening popups in wrong bindings --- chrome/content/zotero/bindings/itembox.xml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/chrome/content/zotero/bindings/itembox.xml b/chrome/content/zotero/bindings/itembox.xml index 4c9d7d81de..9cbfff2eef 100644 --- a/chrome/content/zotero/bindings/itembox.xml +++ b/chrome/content/zotero/bindings/itembox.xml @@ -439,12 +439,14 @@ label.classList.add("pointer"); label.setAttribute("onclick", "ZoteroPane_Local.loadURI('" + doi + "', event)"); label.setAttribute("tooltiptext", Zotero.getString('locate.online.tooltip')); - valueElement.setAttribute('contextmenu', 'zotero-doi-menu'); + valueElement.oncontextmenu = () => { + this._id('zotero-doi-menu').openPopup(valueElement); + }; - var openURLMenuItem = document.getElementById('zotero-doi-menu-view-online'); + var openURLMenuItem = this._id('zotero-doi-menu-view-online'); openURLMenuItem.setAttribute("oncommand", "ZoteroPane_Local.loadURI('" + doi + "', event)"); - var copyMenuItem = document.getElementById('zotero-doi-menu-copy'); + var copyMenuItem = this._id('zotero-doi-menu-copy'); copyMenuItem.setAttribute("oncommand", "Zotero.Utilities.Internal.copyTextToClipboard('" + doi + "')"); } } @@ -804,7 +806,10 @@ } if (this.editable && fieldMode == 0) { - firstlast.setAttribute('contextmenu', 'zotero-creator-transform-menu'); + firstlast.oncontextmenu = () => { + document.popupNode = firstlast; + this._id('zotero-creator-transform-menu').openPopup(firstlast); + }; } this._tabIndexMaxCreators = Math.max(this._tabIndexMaxCreators, tabindex); @@ -1374,7 +1379,10 @@ if (this.editable && (fieldName == 'seriesTitle' || fieldName == 'shortTitle' || Zotero.ItemFields.isFieldOfBase(fieldID, 'title') || Zotero.ItemFields.isFieldOfBase(fieldID, 'publicationTitle'))) { - valueElement.setAttribute('contextmenu', 'zotero-field-transform-menu'); + valueElement.oncontextmenu = () => { + document.popupNode = valueElement; + this._id('zotero-field-transform-menu').openPopup(valueElement); + }; } } @@ -2181,7 +2189,7 @@