fx-compat: Show native field/creator transform popups

No longer anchored to the element, but instead to the cursor.
This commit is contained in:
Abe Jellinek 2022-06-17 18:49:07 -05:00
parent c31df4ae6b
commit 0e1a16b96b

View file

@ -908,9 +908,13 @@
}
if (this.editable && fieldMode == 0) {
firstlast.oncontextmenu = () => {
firstlast.oncontextmenu = (event) => {
document.popupNode = firstlast;
this._id('zotero-creator-transform-menu').openPopup(firstlast);
this._id('zotero-creator-transform-menu').openPopupAtScreen(
event.screenX + 1,
event.screenY + 1,
true
);
};
}
@ -1404,9 +1408,14 @@
if (this.editable && (fieldName == 'seriesTitle' || fieldName == 'shortTitle' ||
Zotero.ItemFields.isFieldOfBase(fieldID, 'title') ||
Zotero.ItemFields.isFieldOfBase(fieldID, 'publicationTitle'))) {
valueElement.oncontextmenu = () => {
valueElement.setAttribute('context', 'zotero-field-transform-menu');
valueElement.oncontextmenu = (event) => {
document.popupNode = valueElement;
this._id('zotero-field-transform-menu').openPopup(valueElement);
this._id('zotero-field-transform-menu').openPopupAtScreen(
event.screenX + 1,
event.screenY + 1,
true
);
};
}
}