From 3d9853acaa53be34f70bff30e11fe034a672bb8e Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 30 Apr 2014 14:29:59 -0400 Subject: [PATCH] Redo instead of toggling Z pane in text fields (except search bar) on OS X Previously Cmd-Shift-Z worked for redo in text areas (Abstract, Extra) but would toggle the Zotero pane in regular text fields. This change allows Redo to work as expected. The search bar gets focus when you first open the Zotero pane, though, so we don't redo there, since it would be annoying if you couldn't close the pane immediately with the same shortcut. --- chrome/content/zotero/zoteroPane.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index 59ae609a76..1d4192dc05 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -631,9 +631,19 @@ var ZoteroPane = new function() try { // Ignore Cmd-Shift-Z keystroke in text areas if (Zotero.isMac && key == 'Z' && - event.originalTarget.localName == 'textarea') { - Zotero.debug('Ignoring keystroke in text area'); - return; + (event.originalTarget.localName == 'input' + || event.originalTarget.localName == 'textarea')) { + try { + var isSearchBar = event.originalTarget.parentNode.parentNode.id == 'zotero-tb-search'; + } + catch (e) { + Zotero.debug(e, 1); + Components.utils.reportError(e); + } + if (!isSearchBar) { + Zotero.debug('Ignoring keystroke in text field'); + return; + } } } catch (e) {