From ab433b472ef4e620aa9dfc98d997942c59182de6 Mon Sep 17 00:00:00 2001 From: azivner Date: Wed, 22 Nov 2017 20:29:22 -0500 Subject: [PATCH] fix broken sending expanded to server --- public/javascripts/note_tree.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/public/javascripts/note_tree.js b/public/javascripts/note_tree.js index 2da64051c..55c50f276 100644 --- a/public/javascripts/note_tree.js +++ b/public/javascripts/note_tree.js @@ -342,10 +342,10 @@ const noteTree = (function() { return false; }, expand: (event, data) => { - setExpandedToServer(getNoteTreeIdFromKey(data.node.key), true); + setExpandedToServer(data.node.data.note_tree_id, true); }, collapse: (event, data) => { - setExpandedToServer(getNoteTreeIdFromKey(data.node.key), false); + setExpandedToServer(data.node.data.note_tree_id, false); }, init: (event, data) => { if (startNoteTreeId) { @@ -525,9 +525,7 @@ const noteTree = (function() { } function setCurrentNoteTreeBasedOnProtectedStatus() { - const node = getCurrentNode(); - - node.toggleClass("protected", !!node.data.is_protected); + getCurrentClones().map(node => node.toggleClass("protected", !!node.data.is_protected)); } function getAutocompleteItems(parentNoteId, notePath, titlePath) {