From eba00e6ff83c4e6601d1001227577f3f9e90d446 Mon Sep 17 00:00:00 2001 From: azivner Date: Sat, 23 Dec 2017 08:24:03 -0500 Subject: [PATCH] target note is expanded after cloning into it CTRL-V pastes into instead of after showing messages about clipboard operations --- public/javascripts/note_tree.js | 21 +++++++++++++++------ routes/api/notes_move.js | 2 ++ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/public/javascripts/note_tree.js b/public/javascripts/note_tree.js index b913ef4d5..7d4a63230 100644 --- a/public/javascripts/note_tree.js +++ b/public/javascripts/note_tree.js @@ -472,18 +472,27 @@ const noteTree = (function() { case 67: if (event.ctrlKey) { // Ctrl-C contextMenu.copy(node); - return false; - } - break; - case 86: - if (event.ctrlKey) { // Ctrl-V - contextMenu.pasteAfter(node); + + showMessage("Note copied into clipboard."); + return false; } break; case 88: if (event.ctrlKey) { // Ctrl-X contextMenu.cut(node); + + showMessage("Note cut into clipboard."); + + return false; + } + break; + case 86: + if (event.ctrlKey) { // Ctrl-V + contextMenu.pasteInto(node); + + showMessage("Note pasted from clipboard into current note."); + return false; } break; diff --git a/routes/api/notes_move.js b/routes/api/notes_move.js index ec4ff5f1d..4ec2fd44d 100644 --- a/routes/api/notes_move.js +++ b/routes/api/notes_move.js @@ -127,6 +127,8 @@ router.put('/:childNoteId/clone-to/:parentNoteId', auth.checkApiAuth, async (req await sql.replace("notes_tree", noteTree); await sync_table.addNoteTreeSync(noteTree.note_tree_id, sourceId); + + await sql.execute("UPDATE notes_tree SET is_expanded = 1 WHERE note_id = ?", [parentNoteId]); }); res.send({