www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 2011a6122325bf9ae29cf3b3f9380feddba62e97
parent 740795f24935eadf45dbe058cd204679b974e7df
Author: Dan Stillman <dstillman@zotero.org>
Date:   Thu, 12 Jan 2017 02:38:32 -0500

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)

Diffstat:
Mchrome/content/zotero/xpcom/itemTreeView.js | 13-------------
Mchrome/content/zotero/zoteroPane.js | 11+++++------
2 files changed, 5 insertions(+), 19 deletions(-)

diff --git a/chrome/content/zotero/xpcom/itemTreeView.js b/chrome/content/zotero/xpcom/itemTreeView.js @@ -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) { diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js @@ -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) ||