From 332fc16852446859cc346f3b517cc513233471a2 Mon Sep 17 00:00:00 2001 From: azivner Date: Wed, 27 Dec 2017 22:44:27 -0500 Subject: [PATCH] fix pasting into non-expanded non-loaded node (UI only) --- public/javascripts/tree_changes.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/public/javascripts/tree_changes.js b/public/javascripts/tree_changes.js index 9c648dbcf..0c382fc34 100644 --- a/public/javascripts/tree_changes.js +++ b/public/javascripts/tree_changes.js @@ -29,10 +29,12 @@ const treeChanges = (function() { await server.put('notes/' + node.data.note_tree_id + '/move-to/' + toNode.data.note_id); changeNode(node, node => { - node.moveTo(toNode); - + // first expand which will force lazy load and only then move the node + // if this is not expanded before moving, then lazy load won't happen because it already contains node toNode.setExpanded(true); + node.moveTo(toNode); + toNode.folder = true; toNode.renderTitle(); });