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:
parent
5913e6780e
commit
3d9853acaa
1 changed files with 13 additions and 3 deletions
|
@ -631,11 +631,21 @@ 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');
|
||||
(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) {
|
||||
Zotero.debug(e);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue