Skip to content

Commit

Permalink
Don't focus note editor when pressing Shift-Tab on note in middle pane
Browse files Browse the repository at this point in the history
Reverts redundant code from 7e39e46 (zotero#1136) and fixes the much earlier
9d7cc84 (zotero#151)
  • Loading branch information
dstillman committed Jan 12, 2017
1 parent 740795f commit 2011a61
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
13 changes: 0 additions & 13 deletions chrome/content/zotero/xpcom/itemTreeView.js
Expand Up @@ -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) {
Expand Down
11 changes: 5 additions & 6 deletions chrome/content/zotero/zoteroPane.js
Expand Up @@ -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) ||
Expand Down

0 comments on commit 2011a61

Please sign in to comment.