From 22e905aa99c401849aa77a51da8f9b072992c410 Mon Sep 17 00:00:00 2001 From: azivner Date: Fri, 7 Sep 2018 10:50:05 +0200 Subject: [PATCH] enter on note in note tree leads to note title instead of content (second enter then goes to content) --- src/public/javascripts/services/note_detail.js | 8 +++----- src/public/javascripts/services/tree_keybindings.js | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/public/javascripts/services/note_detail.js b/src/public/javascripts/services/note_detail.js index ad6a11a5e..6cae0511f 100644 --- a/src/public/javascripts/services/note_detail.js +++ b/src/public/javascripts/services/note_detail.js @@ -513,10 +513,8 @@ async function loadNote(noteId) { return new NoteFull(treeCache, row); } -function focus() { - const note = getCurrentNote(); - - getComponent(note.type).focus(); +function focusOnTitle() { + $noteTitle.focus(); } messagingService.subscribeToSyncMessages(syncData => { @@ -554,7 +552,7 @@ export default { getCurrentNoteType, getCurrentNoteId, newNoteCreated, - focus, + focusOnTitle, getAttributes, showAttributes, refreshAttributes, diff --git a/src/public/javascripts/services/tree_keybindings.js b/src/public/javascripts/services/tree_keybindings.js index df70bca91..7219994d8 100644 --- a/src/public/javascripts/services/tree_keybindings.js +++ b/src/public/javascripts/services/tree_keybindings.js @@ -100,7 +100,7 @@ const keyBindings = { return false; }, "return": node => { - noteDetailService.focus(); + noteDetailService.focusOnTitle(); return false; },