From 4e0d83e9de6c7214d6dc66d794dcaa0dac71f093 Mon Sep 17 00:00:00 2001 From: azivner Date: Wed, 22 Nov 2017 19:40:06 -0500 Subject: [PATCH] basic ExtClones integration. Other "clones" are now marked as bold when their clone is activated --- public/javascripts/note_tree.js | 7 ++++++- public/stylesheets/style.css | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/public/javascripts/note_tree.js b/public/javascripts/note_tree.js index b3b420f3c..c299e6a22 100644 --- a/public/javascripts/note_tree.js +++ b/public/javascripts/note_tree.js @@ -123,6 +123,7 @@ const noteTree = (function() { } note.key = counter++ + ""; // key needs to be string + note.refKey = note.note_id; note.expanded = note.is_expanded; noteTreeIdToKey[noteTreeId] = note.key; @@ -325,7 +326,7 @@ const noteTree = (function() { treeEl.fancytree({ autoScroll: true, - extensions: ["hotkeys", "filter", "dnd"], + extensions: ["hotkeys", "filter", "dnd", "clones"], source: noteTree, scrollParent: $("#tree"), activate: (event, data) => { @@ -336,6 +337,7 @@ const noteTree = (function() { noteEditor.switchToNote(node.note_id); showParentList(node.note_id, data.node); + return false; }, expand: (event, data) => { setExpandedToServer(getNoteTreeIdFromKey(data.node.key), true); @@ -417,6 +419,9 @@ const noteTree = (function() { const node = data.node.data; data.result = prepareNoteTreeInner(node.note_id); + }, + clones: { + highlightActiveClones: true } }); diff --git a/public/stylesheets/style.css b/public/stylesheets/style.css index b0abf0ad6..2c27a9efc 100644 --- a/public/stylesheets/style.css +++ b/public/stylesheets/style.css @@ -78,6 +78,10 @@ span.fancytree-node.multiple-parents .fancytree-title { text-decoration: underline dashed; } +span.fancytree-node.fancytree-active-clone:not(.fancytree-active) .fancytree-title { + font-weight: bold; +} + .ui-autocomplete { max-height: 300px; overflow-y: auto;