From 5919f0e77a06fce9cedd7490d37218cd58e3f541 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 12 Jan 2023 20:26:34 -0500 Subject: [PATCH] Fix DOI field context menu not appearing after field edit Context menu wouldn't appear again until the item box was refreshed --- chrome/content/zotero/bindings/itembox.xml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/bindings/itembox.xml b/chrome/content/zotero/bindings/itembox.xml index d9c7155384..17587cff5c 100644 --- a/chrome/content/zotero/bindings/itembox.xml +++ b/chrome/content/zotero/bindings/itembox.xml @@ -440,9 +440,6 @@ label.classList.add("pointer"); label.addEventListener('click', event => ZoteroPane_Local.loadURI(doi, event)); label.setAttribute("tooltiptext", Zotero.getString('pane.item.viewOnline.tooltip')); - valueElement.oncontextmenu = () => { - this._id('zotero-doi-menu').openPopup(valueElement); - }; var openURLMenuItem = this._id('zotero-doi-menu-view-online'); openURLMenuItem.addEventListener('command', event => ZoteroPane_Local.loadURI(doi, event)); @@ -1423,6 +1420,13 @@ valueElement.setAttribute('flex', '1'); } + // Add popup menu on DOI field with value + if (fieldName == 'DOI' && valueText) { + valueElement.oncontextmenu = () => { + this._id('zotero-doi-menu').openPopup(valueElement); + }; + } + var firstSpace = valueText.indexOf(" "); // To support newlines in Abstract and Extra fields, use multiple