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.
This commit is contained in:
Dan Stillman 2014-04-30 14:29:59 -04:00
parent 5913e6780e
commit 3d9853acaa

View file

@ -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) {