more actions on jump to note dialog

This commit is contained in:
azivner
2017-11-19 22:31:30 -05:00
parent c8aaf6085d
commit d98a5b6299
4 changed files with 62 additions and 24 deletions

View File

@@ -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
};
})();