Don't focus note editor when pressing Shift-Tab on note in middle pane

Reverts redundant code from 7e39e4608 (#1136) and fixes the much earlier
9d7cc849 (#151)
This commit is contained in:
Dan Stillman 2017-01-12 02:38:32 -05:00
parent 740795f249
commit 2011a61223
2 changed files with 5 additions and 19 deletions

View file

@ -129,19 +129,6 @@ Zotero.ItemTreeView.prototype.setTree = Zotero.Promise.coroutine(function* (tree
return;
}
// Focus note editor when Tab is pressed on a selected note
if (event.keyCode == event.DOM_VK_TAB) {
let items = this.getSelectedItems();
if (items.length == 1 && items[0].isNote()) {
let noteEditor = this._ownerDocument.getElementById('zotero-note-editor');
if (noteEditor) {
noteEditor.focus();
event.preventDefault();
}
}
return;
}
// Handle arrow keys specially on multiple selection, since
// otherwise the tree just applies it to the last-selected row
if (event.keyCode == 39 || event.keyCode == 37) {

View file

@ -593,14 +593,13 @@ var ZoteroPane = new function()
}
}
else if (from == 'zotero-items-tree') {
// Focus TinyMCE explicitly on tab key, since the normal focusing
// doesn't work right
if (!event.shiftKey && event.keyCode == String.fromCharCode(event.which)) {
// Focus TinyMCE explicitly on tab key, since the normal focusing doesn't work right
if (!event.shiftKey && event.keyCode == event.DOM_VK_TAB) {
var deck = document.getElementById('zotero-item-pane-content');
if (deck.selectedPanel.id == 'zotero-view-note') {
setTimeout(function () {
document.getElementById('zotero-note-editor').focus();
}, 0);
document.getElementById('zotero-note-editor').focus();
event.preventDefault();
return;
}
}
else if ((event.keyCode == event.DOM_VK_BACK_SPACE && Zotero.isMac) ||