mirror of
https://github.com/zadam/trilium.git
synced 2025-11-12 00:05:50 +01:00
library upgrades
This commit is contained in:
@@ -3,7 +3,7 @@ import treeCache from "./tree_cache.js";
|
||||
import ws from "./ws.js";
|
||||
import hoistedNoteService from "./hoisted_note.js";
|
||||
|
||||
async function prepareTree() {
|
||||
async function prepareRootNode() {
|
||||
await treeCache.initializedPromise;
|
||||
|
||||
const hoistedNoteId = hoistedNoteService.getHoistedNoteId();
|
||||
@@ -18,7 +18,7 @@ async function prepareTree() {
|
||||
hoistedBranch = (await hoistedNote.getBranches())[0];
|
||||
}
|
||||
|
||||
return [ await prepareNode(hoistedBranch) ];
|
||||
return await prepareNode(hoistedBranch);
|
||||
}
|
||||
|
||||
async function prepareBranch(note) {
|
||||
@@ -167,7 +167,7 @@ function getExtraClasses(note) {
|
||||
}
|
||||
|
||||
export default {
|
||||
prepareTree,
|
||||
prepareRootNode,
|
||||
prepareBranch,
|
||||
getExtraClasses,
|
||||
getIcon
|
||||
|
||||
@@ -68,13 +68,13 @@ export default class NoteTreeWidget extends TabAwareWidget {
|
||||
}
|
||||
});
|
||||
|
||||
this.initialized = treeBuilder.prepareTree().then(treeData => this.initFancyTree(treeData));
|
||||
this.initialized = this.initFancyTree();
|
||||
|
||||
return this.$widget;
|
||||
}
|
||||
|
||||
async initFancyTree(treeData) {
|
||||
utils.assertArguments(treeData);
|
||||
async initFancyTree() {
|
||||
const treeData = [await treeBuilder.prepareRootNode()];
|
||||
|
||||
this.$widget.fancytree({
|
||||
autoScroll: true,
|
||||
@@ -414,8 +414,10 @@ export default class NoteTreeWidget extends TabAwareWidget {
|
||||
return list ? list : []; // if no nodes with this refKey are found, fancy tree returns null
|
||||
}
|
||||
|
||||
async reload(notes) {
|
||||
await this.tree.reload(notes);
|
||||
async reload() {
|
||||
const rootNode = await treeBuilder.prepareRootNode();
|
||||
|
||||
await this.tree.reload([rootNode]);
|
||||
}
|
||||
|
||||
// must be event since it's triggered from outside the tree
|
||||
@@ -581,13 +583,11 @@ export default class NoteTreeWidget extends TabAwareWidget {
|
||||
}
|
||||
|
||||
async reloadTreeFromCache() {
|
||||
const notes = await treeBuilder.prepareTree();
|
||||
|
||||
const activeNode = this.getActiveNode();
|
||||
|
||||
const activeNotePath = activeNode !== null ? treeService.getNotePath(activeNode) : null;
|
||||
|
||||
await this.reload(notes);
|
||||
await this.reload();
|
||||
|
||||
if (activeNotePath) {
|
||||
const node = await this.getNodeFromPath(activeNotePath, true);
|
||||
|
||||
@@ -12,30 +12,30 @@
|
||||
|
||||
<div class="dropdown-menu dropdown-menu-sm" id="context-menu-container"></div>
|
||||
|
||||
<% include dialogs/about.ejs %>
|
||||
<% include dialogs/add_link.ejs %>
|
||||
<% include dialogs/attributes.ejs %>
|
||||
<% include dialogs/branch_prefix.ejs %>
|
||||
<% include dialogs/export.ejs %>
|
||||
<% include dialogs/import.ejs %>
|
||||
<% include dialogs/jump_to_note.ejs %>
|
||||
<% include dialogs/markdown_import.ejs %>
|
||||
<% include dialogs/note_revisions.ejs %>
|
||||
<% include dialogs/note_source.ejs %>
|
||||
<% include dialogs/options.ejs %>
|
||||
<% include dialogs/protected_session_password.ejs %>
|
||||
<% include dialogs/recent_changes.ejs %>
|
||||
<% include dialogs/sql_console.ejs %>
|
||||
<% include dialogs/info.ejs %>
|
||||
<% include dialogs/prompt.ejs %>
|
||||
<% include dialogs/confirm.ejs %>
|
||||
<% include dialogs/help.ejs %>
|
||||
<% include dialogs/note_info.ejs %>
|
||||
<% include dialogs/link_map.ejs %>
|
||||
<% include dialogs/clone_to.ejs %>
|
||||
<% include dialogs/move_to.ejs %>
|
||||
<% include dialogs/backend_log.ejs %>
|
||||
<% include dialogs/include_note.ejs %>
|
||||
<%- include('dialogs/about.ejs') %>
|
||||
<%- include('dialogs/add_link.ejs') %>
|
||||
<%- include('dialogs/attributes.ejs') %>
|
||||
<%- include('dialogs/branch_prefix.ejs') %>
|
||||
<%- include('dialogs/export.ejs') %>
|
||||
<%- include('dialogs/import.ejs') %>
|
||||
<%- include('dialogs/jump_to_note.ejs') %>
|
||||
<%- include('dialogs/markdown_import.ejs') %>
|
||||
<%- include('dialogs/note_revisions.ejs') %>
|
||||
<%- include('dialogs/note_source.ejs') %>
|
||||
<%- include('dialogs/options.ejs') %>
|
||||
<%- include('dialogs/protected_session_password.ejs') %>
|
||||
<%- include('dialogs/recent_changes.ejs') %>
|
||||
<%- include('dialogs/sql_console.ejs') %>
|
||||
<%- include('dialogs/info.ejs') %>
|
||||
<%- include('dialogs/prompt.ejs') %>
|
||||
<%- include('dialogs/confirm.ejs') %>
|
||||
<%- include('dialogs/help.ejs') %>
|
||||
<%- include('dialogs/note_info.ejs') %>
|
||||
<%- include('dialogs/link_map.ejs') %>
|
||||
<%- include('dialogs/clone_to.ejs') %>
|
||||
<%- include('dialogs/move_to.ejs') %>
|
||||
<%- include('dialogs/backend_log.ejs') %>
|
||||
<%- include('dialogs/include_note.ejs') %>
|
||||
|
||||
<script type="text/javascript">
|
||||
window.baseApiUrl = 'api/';
|
||||
@@ -60,8 +60,8 @@
|
||||
<script src="libraries/bootstrap/js/bootstrap.bundle.min.js"></script>
|
||||
|
||||
<!-- Include Fancytree skin and library -->
|
||||
<link href="libraries/fancytree/skin-win8/ui.fancytree.css" rel="stylesheet">
|
||||
<script src="libraries/fancytree/jquery.fancytree-all-deps.js"></script>
|
||||
<link href="libraries/fancytree/skin-win8/ui.fancytree.min.css" rel="stylesheet">
|
||||
<script src="libraries/fancytree/jquery.fancytree-all-deps.min.js"></script>
|
||||
|
||||
<script src="libraries/jquery.hotkeys.js"></script>
|
||||
<script src="libraries/jquery.fancytree.hotkeys.js"></script>
|
||||
|
||||
Reference in New Issue
Block a user