mirror of
https://github.com/zadam/trilium.git
synced 2025-12-23 08:39:57 +01:00
more actions on jump to note dialog
This commit is contained in:
@@ -66,6 +66,19 @@ const treeUtils = (function() {
|
||||
return path.reverse().join("/");
|
||||
}
|
||||
|
||||
async function addAsChild(parentNotePath, childNotePath) {
|
||||
const parentNoteId = treeUtils.getNoteIdFromNotePath(parentNotePath);
|
||||
const childNoteId = treeUtils.getNoteIdFromNotePath(childNotePath);
|
||||
|
||||
await $.ajax({
|
||||
url: baseApiUrl + 'tree/' + parentNoteId + '/addChild/' + childNoteId,
|
||||
type: 'PUT',
|
||||
error: () => showError("Error adding child.")
|
||||
});
|
||||
|
||||
await noteTree.reload();
|
||||
}
|
||||
|
||||
return {
|
||||
getParentNoteTreeId,
|
||||
getParentProtectedStatus,
|
||||
@@ -74,6 +87,7 @@ const treeUtils = (function() {
|
||||
getFullName,
|
||||
getFullNameForPath,
|
||||
getNotePath,
|
||||
getNoteIdFromNotePath
|
||||
getNoteIdFromNotePath,
|
||||
addAsChild
|
||||
};
|
||||
})();
|
||||
Reference in New Issue
Block a user