commit 3d9853acaa53be34f70bff30e11fe034a672bb8e
parent 5913e6780e6bc885551db508c84c4a3b7ab25206
Author: Dan Stillman <dstillman@zotero.org>
Date: Wed, 30 Apr 2014 14:29:59 -0400
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.
Diffstat:
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git 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) {