Don't focus note editor when pressing Shift-Tab on note in middle pane
Reverts redundant code from7e39e4608
(#1136) and fixes the much earlier9d7cc849
(#151)
This commit is contained in:
parent
740795f249
commit
2011a61223
|
@ -129,19 +129,6 @@ Zotero.ItemTreeView.prototype.setTree = Zotero.Promise.coroutine(function* (tree
|
||||||
return;
|
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
|
// Handle arrow keys specially on multiple selection, since
|
||||||
// otherwise the tree just applies it to the last-selected row
|
// otherwise the tree just applies it to the last-selected row
|
||||||
if (event.keyCode == 39 || event.keyCode == 37) {
|
if (event.keyCode == 39 || event.keyCode == 37) {
|
||||||
|
|
|
@ -593,14 +593,13 @@ var ZoteroPane = new function()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (from == 'zotero-items-tree') {
|
else if (from == 'zotero-items-tree') {
|
||||||
// Focus TinyMCE explicitly on tab key, since the normal focusing
|
// Focus TinyMCE explicitly on tab key, since the normal focusing doesn't work right
|
||||||
// doesn't work right
|
if (!event.shiftKey && event.keyCode == event.DOM_VK_TAB) {
|
||||||
if (!event.shiftKey && event.keyCode == String.fromCharCode(event.which)) {
|
|
||||||
var deck = document.getElementById('zotero-item-pane-content');
|
var deck = document.getElementById('zotero-item-pane-content');
|
||||||
if (deck.selectedPanel.id == 'zotero-view-note') {
|
if (deck.selectedPanel.id == 'zotero-view-note') {
|
||||||
setTimeout(function () {
|
|
||||||
document.getElementById('zotero-note-editor').focus();
|
document.getElementById('zotero-note-editor').focus();
|
||||||
}, 0);
|
event.preventDefault();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((event.keyCode == event.DOM_VK_BACK_SPACE && Zotero.isMac) ||
|
else if ((event.keyCode == event.DOM_VK_BACK_SPACE && Zotero.isMac) ||
|
||||||
|
|
Loading…
Reference in New Issue
Block a user