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:
parent
f006995676
commit
5919f0e77a
1 changed files with 7 additions and 3 deletions
|
@ -440,9 +440,6 @@
|
||||||
label.classList.add("pointer");
|
label.classList.add("pointer");
|
||||||
label.addEventListener('click', event => ZoteroPane_Local.loadURI(doi, event));
|
label.addEventListener('click', event => ZoteroPane_Local.loadURI(doi, event));
|
||||||
label.setAttribute("tooltiptext", Zotero.getString('pane.item.viewOnline.tooltip'));
|
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');
|
var openURLMenuItem = this._id('zotero-doi-menu-view-online');
|
||||||
openURLMenuItem.addEventListener('command', event => ZoteroPane_Local.loadURI(doi, event));
|
openURLMenuItem.addEventListener('command', event => ZoteroPane_Local.loadURI(doi, event));
|
||||||
|
@ -1423,6 +1420,13 @@
|
||||||
valueElement.setAttribute('flex', '1');
|
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(" ");
|
var firstSpace = valueText.indexOf(" ");
|
||||||
|
|
||||||
// To support newlines in Abstract and Extra fields, use multiple
|
// To support newlines in Abstract and Extra fields, use multiple
|
||||||
|
|
Loading…
Reference in a new issue