mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 19:05:59 +01:00
further refactorings, got rid of init.js
This commit is contained in:
@@ -610,8 +610,6 @@ async function loadTree() {
|
||||
return await prepareBranch(resp.notes, resp.branches);
|
||||
}
|
||||
|
||||
$(() => loadTree().then(branch => initFancyTree(branch)));
|
||||
|
||||
function collapseTree(node = null) {
|
||||
if (!node) {
|
||||
node = $tree.fancytree("getRootNode");
|
||||
@@ -733,6 +731,12 @@ async function sortAlphabetically(noteId) {
|
||||
await reload();
|
||||
}
|
||||
|
||||
async function showTree() {
|
||||
const tree = await loadTree();
|
||||
|
||||
initFancyTree(tree);
|
||||
}
|
||||
|
||||
messagingService.subscribeToMessages(syncData => {
|
||||
if (syncData.some(sync => sync.entityName === 'branches')
|
||||
|| syncData.some(sync => sync.entityName === 'notes')) {
|
||||
@@ -797,5 +801,6 @@ export default {
|
||||
createNewTopLevelNote,
|
||||
createNote,
|
||||
getSelectedNodes,
|
||||
sortAlphabetically
|
||||
sortAlphabetically,
|
||||
showTree
|
||||
};
|
||||
Reference in New Issue
Block a user