basic ExtClones integration. Other "clones" are now marked as bold when their clone is activated

This commit is contained in:
azivner 2017-11-22 19:40:06 -05:00
parent 5cec7a497b
commit 4e0d83e9de
2 changed files with 10 additions and 1 deletions

View File

@ -123,6 +123,7 @@ const noteTree = (function() {
} }
note.key = counter++ + ""; // key needs to be string note.key = counter++ + ""; // key needs to be string
note.refKey = note.note_id;
note.expanded = note.is_expanded; note.expanded = note.is_expanded;
noteTreeIdToKey[noteTreeId] = note.key; noteTreeIdToKey[noteTreeId] = note.key;
@ -325,7 +326,7 @@ const noteTree = (function() {
treeEl.fancytree({ treeEl.fancytree({
autoScroll: true, autoScroll: true,
extensions: ["hotkeys", "filter", "dnd"], extensions: ["hotkeys", "filter", "dnd", "clones"],
source: noteTree, source: noteTree,
scrollParent: $("#tree"), scrollParent: $("#tree"),
activate: (event, data) => { activate: (event, data) => {
@ -336,6 +337,7 @@ const noteTree = (function() {
noteEditor.switchToNote(node.note_id); noteEditor.switchToNote(node.note_id);
showParentList(node.note_id, data.node); showParentList(node.note_id, data.node);
return false;
}, },
expand: (event, data) => { expand: (event, data) => {
setExpandedToServer(getNoteTreeIdFromKey(data.node.key), true); setExpandedToServer(getNoteTreeIdFromKey(data.node.key), true);
@ -417,6 +419,9 @@ const noteTree = (function() {
const node = data.node.data; const node = data.node.data;
data.result = prepareNoteTreeInner(node.note_id); data.result = prepareNoteTreeInner(node.note_id);
},
clones: {
highlightActiveClones: true
} }
}); });

View File

@ -78,6 +78,10 @@ span.fancytree-node.multiple-parents .fancytree-title {
text-decoration: underline dashed; text-decoration: underline dashed;
} }
span.fancytree-node.fancytree-active-clone:not(.fancytree-active) .fancytree-title {
font-weight: bold;
}
.ui-autocomplete { .ui-autocomplete {
max-height: 300px; max-height: 300px;
overflow-y: auto; overflow-y: auto;