diff --git a/src/public/javascripts/services/dialog_command_executor.js b/src/public/javascripts/services/dialog_command_executor.js index 6d5a7e132..bc6f3b7fc 100644 --- a/src/public/javascripts/services/dialog_command_executor.js +++ b/src/public/javascripts/services/dialog_command_executor.js @@ -33,16 +33,6 @@ export default class DialogCommandExecutor extends Component { import("../dialogs/markdown_import.js").then(d => d.importMarkdownInline()); } - async cloneNotesToCommand() { - // FIXME - const selectedOrActiveNodes = this.appContext.getMainNoteTree().getSelectedOrActiveNodes(); - - const noteIds = selectedOrActiveNodes.map(node => node.data.noteId); - - const d = await import("../dialogs/clone_to.js"); - d.showDialog(noteIds); - } - async editBranchPrefixCommand() { const notePath = this.appContext.tabManager.getActiveTabNotePath(); @@ -56,6 +46,11 @@ export default class DialogCommandExecutor extends Component { import("../dialogs/add_link.js").then(d => d.showDialog()); } + async cloneNoteIdsToCommand({noteIds}) { + const d = await import("../dialogs/clone_to.js"); + d.showDialog(noteIds); + } + async moveBranchIdsToCommand({branchIds}) { const d = await import("../dialogs/move_to.js"); d.showDialog(branchIds); diff --git a/src/public/javascripts/widgets/note_tree.js b/src/public/javascripts/widgets/note_tree.js index 496f723da..59bcdf805 100644 --- a/src/public/javascripts/widgets/note_tree.js +++ b/src/public/javascripts/widgets/note_tree.js @@ -617,6 +617,12 @@ export default class NoteTreeWidget extends TabAwareWidget { this.reloadTreeFromCache(); } + async cloneNotesToCommand() { + const selectedOrActiveNoteIds = this.getSelectedOrActiveNodes().map(node => node.data.noteId); + + this.triggerCommand('cloneNoteIdsTo', {noteIds: selectedOrActiveNoteIds}); + } + async moveNotesToCommand() { const selectedOrActiveBranchIds = this.getSelectedOrActiveNodes().map(node => node.data.branchId);