From df24917c2f8256c33c09cf39313376bc1a7c9471 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 13 Jul 2017 03:26:28 -0400 Subject: [PATCH] Fix #1260, Windows Application (menu) key doesn't work in items pane --- chrome/content/zotero/zoteroPane.js | 26 ++++++++++++-------------- chrome/content/zotero/zoteroPane.xul | 1 + 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index e3afabe040..d1c0dc84f8 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -2666,6 +2666,18 @@ var ZoteroPane = new function() } }; + /** + * Show context menu once it's ready + */ + this.onItemsContextMenuOpen = function (event) { + ZoteroPane.buildItemContextMenu() + .then(function () { + document.getElementById('zotero-itemmenu').openPopup( + null, null, event.clientX + 1, event.clientY + 1, true, false, event + ); + }) + }; + this.buildItemContextMenu = Zotero.Promise.coroutine(function* () { var options = [ 'showInLibrary', @@ -3011,20 +3023,6 @@ var ZoteroPane = new function() } } else if (tree.id == 'zotero-items-tree') { - // Show context menu once it's ready - if (event.button == 2) { - // Allow item to be selected first - setTimeout(function () { - ZoteroPane_Local.buildItemContextMenu() - .then(function () { - document.getElementById('zotero-itemmenu').openPopup( - null, null, event.clientX + 1, event.clientY + 1, true, false, event - ); - }) - }); - return; - } - let collectionTreeRow = ZoteroPane_Local.getCollectionTreeRow(); // Automatically select all equivalent items when clicking on an item diff --git a/chrome/content/zotero/zoteroPane.xul b/chrome/content/zotero/zoteroPane.xul index 58f9db90dd..578d46df0f 100644 --- a/chrome/content/zotero/zoteroPane.xul +++ b/chrome/content/zotero/zoteroPane.xul @@ -375,6 +375,7 @@ onkeydown="ZoteroPane_Local.handleKeyDown(event, this.id)" onselect="ZoteroPane_Local.itemSelected(event)" oncommand="ZoteroPane_Local.serializePersist()" + oncontextmenu="ZoteroPane.onItemsContextMenuOpen(event)" flex="1" hidden="true" zotero-persist="current-view-group">