commit df24917c2f8256c33c09cf39313376bc1a7c9471
parent 2d8132b6c80921515cce14c9a560c53fbc093c7b
Author: Dan Stillman <dstillman@zotero.org>
Date: Thu, 13 Jul 2017 03:26:28 -0400
Fix #1260, Windows Application (menu) key doesn't work in items pane
Diffstat:
2 files changed, 13 insertions(+), 14 deletions(-)
diff --git 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
@@ -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">