support for cloned notes including updating clones. Creating clones is not supported. Renaming is handled a bit differently - all clones and original share the same name, while in Notecase desktop each clone has separate name.

This commit is contained in:
azivner
2017-08-15 21:29:12 -04:00
parent 3c924afbca
commit b986e93356
3 changed files with 19 additions and 4 deletions

View File

@@ -3,6 +3,11 @@ $(function(){
function copyTitle(notes) {
for (let note of notes) {
note.title = note.note_title;
if (note.is_clone) {
note.title += " (clone)";
}
note.key = note.note_id;
note.expanded = note.is_expanded;
@@ -31,8 +36,8 @@ $(function(){
extensions: ["hotkeys"],
source: notes,
activate: function(event, data){
var node = data.node.data;
var noteId = node.note_id;
const node = data.node.data;
const noteId = node.is_clone ? node.note_clone_id : node.note_id;
loadNote(noteId);
},