diff --git a/chrome/content/zotero/lookup.js b/chrome/content/zotero/lookup.js
index 789dff1b66..6abc11f2ba 100644
--- a/chrome/content/zotero/lookup.js
+++ b/chrome/content/zotero/lookup.js
@@ -209,9 +209,7 @@ var Zotero_Lookup = new function () {
this.getActivePanel = function() {
- var mlPanel = document.getElementById("zotero-lookup-multiline");
- if (mlPanel.hidden) return document.getElementById("zotero-lookup-singleLine");
- return mlPanel;
+ return document.getElementById("zotero-lookup-multiline");
};
@@ -254,6 +252,28 @@ var Zotero_Lookup = new function () {
}
};
+ this.onContextMenu = function (event, textBox) {
+ event.preventDefault();
+ let menu = goBuildEditContextMenu().cloneNode(true);
+ goUpdateGlobalEditMenuItems(true);
+ let pasteMenuitem = menu.querySelector("menuitem[data-action='paste']");
+ let pasteCommand = document.getElementById("cmd_paste");
+
+ let pasteAndSearchMenuitem = document.createXULElement("menuitem");
+ document.l10n.setAttributes(pasteAndSearchMenuitem, "text-action-paste-and-search");
+ pasteAndSearchMenuitem.disabled = pasteCommand.hasAttribute("disabled"); // no 'disabled' property
+ pasteAndSearchMenuitem.addEventListener("command", () => {
+ pasteCommand.doCommand();
+ this.accept(textBox);
+ });
+ pasteMenuitem.after(pasteAndSearchMenuitem);
+
+ document.querySelector("popupset").append(menu);
+ menu.addEventListener("popuphiding", () => menu.remove(),
+ { once: true });
+ menu.openPopupAtScreen(event.screenX, event.screenY, true);
+ };
+
this.setMultiline = function (on) {
var mlTxtBox = document.getElementById("zotero-lookup-textbox");
diff --git a/chrome/content/zotero/zoteroPane.xhtml b/chrome/content/zotero/zoteroPane.xhtml
index 422cf695ee..9160421da1 100644
--- a/chrome/content/zotero/zoteroPane.xhtml
+++ b/chrome/content/zotero/zoteroPane.xhtml
@@ -1223,7 +1223,7 @@
class="zotero-tb-button"
tooltiptext="&zotero.toolbar.lookup.label;"
type="panel"
- onmousedown="if (this.disabled) { event.preventDefault(); return; } Zotero_Lookup.showPanel(this)"
+ onmousedown="Zotero_Lookup.handleToolbarButtonMouseDown(event)"
/>
diff --git a/chrome/locale/en-US/zotero/zotero.ftl b/chrome/locale/en-US/zotero/zotero.ftl
index efdf705971..3d6cd7957f 100644
--- a/chrome/locale/en-US/zotero/zotero.ftl
+++ b/chrome/locale/en-US/zotero/zotero.ftl
@@ -671,3 +671,6 @@ post-upgrade-remind-me-later =
.label = { general-remind-me-later }
post-upgrade-done =
.label = { general-done }
+
+text-action-paste-and-search =
+ .label = Paste and Search