Fix DOI field context menu not appearing after field edit

Context menu wouldn't appear again until the item box was refreshed
This commit is contained in:
Dan Stillman 2023-01-12 20:26:34 -05:00
parent f006995676
commit 5919f0e77a

View file

@ -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