mirror of
https://github.com/zadam/trilium.git
synced 2025-10-29 01:06:36 +01:00
cloning in context menu (copy & paste) and a lot of related refactoring and fixes
This commit is contained in:
@@ -79,6 +79,11 @@ const recentNotes = (function() {
|
||||
return selectBoxEl.find("option:selected").val();
|
||||
}
|
||||
|
||||
function getSelectedNoteId() {
|
||||
const notePath = getSelectedNotePath();
|
||||
return treeUtils.getNoteIdFromNotePath(notePath);
|
||||
}
|
||||
|
||||
function setActiveNoteBasedOnRecentNotes() {
|
||||
const notePath = getSelectedNotePath();
|
||||
|
||||
@@ -104,13 +109,13 @@ const recentNotes = (function() {
|
||||
}
|
||||
|
||||
async function addCurrentAsChild() {
|
||||
await treeUtils.addAsChild(getSelectedNotePath(), noteTree.getCurrentNotePath());
|
||||
await treeChanges.cloneNoteTo(noteTree.getCurrentNoteId(), getSelectedNoteId());
|
||||
|
||||
dialogEl.dialog("close");
|
||||
}
|
||||
|
||||
async function addRecentAsChild() {
|
||||
await treeUtils.addAsChild(noteTree.getCurrentNotePath(), getSelectedNotePath());
|
||||
await treeChanges.cloneNoteTo(getSelectedNoteId(), noteTree.getCurrentNoteId());
|
||||
|
||||
dialogEl.dialog("close");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user