From d4d54c5f01171ebd9c4368faed2187b0b1c5a959 Mon Sep 17 00:00:00 2001 From: zadam Date: Tue, 17 Mar 2020 11:28:41 +0100 Subject: [PATCH] fix createNoteInto keyboard shortcut --- src/public/javascripts/services/entrypoints.js | 11 +++++++++++ src/public/javascripts/widgets/note_tree.js | 11 ----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/public/javascripts/services/entrypoints.js b/src/public/javascripts/services/entrypoints.js index 55270ca52..082e1c1e0 100644 --- a/src/public/javascripts/services/entrypoints.js +++ b/src/public/javascripts/services/entrypoints.js @@ -177,4 +177,15 @@ export default class Entrypoints extends Component { this.triggerCommand('moveBranchIdsTo', {branchIds: selectedOrActiveBranchIds}); } + + async createNoteIntoCommand() { + const note = appContext.tabManager.getActiveTabNote(); + + if (note) { + await noteCreateService.createNote(note.noteId, { + isProtected: note.isProtected, + saveSelection: false + }); + } + } } diff --git a/src/public/javascripts/widgets/note_tree.js b/src/public/javascripts/widgets/note_tree.js index ba04363be..5b70b4e45 100644 --- a/src/public/javascripts/widgets/note_tree.js +++ b/src/public/javascripts/widgets/note_tree.js @@ -575,17 +575,6 @@ export default class NoteTreeWidget extends TabAwareWidget { }); } - async createNoteIntoCommand() { - const node = this.getActiveNode(); - - if (node) { - await noteCreateService.createNote(node.data.noteId, { - isProtected: node.data.isProtected, - saveSelection: false - }); - } - } - async setExpandedToServer(branchId, isExpanded) { utils.assertArguments(branchId);