cloning in context menu (copy & paste) and a lot of related refactoring and fixes

This commit is contained in:
azivner
2017-11-22 23:16:54 -05:00
parent c1fca4764b
commit acba72ec4c
12 changed files with 260 additions and 188 deletions

View File

@@ -29,6 +29,11 @@ const jumpToNote = (function() {
return link.getNodePathFromLabel(val);
}
function getSelectedNoteId() {
const notePath = getSelectedNotePath();
return treeUtils.getNoteIdFromNotePath(notePath);
}
function goToNote() {
const notePath = getSelectedNotePath();
@@ -63,12 +68,12 @@ const jumpToNote = (function() {
}
}
else if (action === 'add-current-as-child') {
treeUtils.addAsChild(getSelectedNotePath(), noteTree.getCurrentNotePath());
treeChanges.cloneNoteTo(noteTree.getCurrentNoteId(), getSelectedNoteId());
dialogEl.dialog("close");
}
else if (action === 'add-selected-as-child') {
treeUtils.addAsChild(noteTree.getCurrentNotePath(), getSelectedNotePath());
treeChanges.cloneNoteTo(getSelectedNoteId(), noteTree.getCurrentNoteId());
dialogEl.dialog("close");
}