mirror of
https://github.com/zadam/trilium.git
synced 2025-03-11 14:33:29 +08:00
make frontendStartup event deterministic after the tree and tabs are loaded, fixes #543
This commit is contained in:
parent
bb43014230
commit
890c00d4ba
3 changed files with 9 additions and 4 deletions
|
@ -160,8 +160,6 @@ entrypoints.registerEntrypoints();
|
|||
|
||||
noteTooltipService.setupGlobalTooltip();
|
||||
|
||||
bundle.executeStartupBundles();
|
||||
|
||||
linkService.init();
|
||||
|
||||
noteAutocompleteService.init();
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import contextMenuWidget from './context_menu.js';
|
||||
import dragAndDropSetup from './drag_and_drop.js';
|
||||
import linkService from './link.js';
|
||||
import messagingService from './messaging.js';
|
||||
import noteDetailService from './note_detail.js';
|
||||
import protectedSessionHolder from './protected_session_holder.js';
|
||||
|
@ -17,12 +16,16 @@ import hoistedNoteService from '../services/hoisted_note.js';
|
|||
import confirmDialog from "../dialogs/confirm.js";
|
||||
import optionsInit from "../services/options_init.js";
|
||||
import TreeContextMenu from "./tree_context_menu.js";
|
||||
import bundle from "./bundle.js";
|
||||
|
||||
const $tree = $("#tree");
|
||||
const $createTopLevelNoteButton = $("#create-top-level-note-button");
|
||||
const $collapseTreeButton = $("#collapse-tree-button");
|
||||
const $scrollToActiveNoteButton = $("#scroll-to-active-note-button");
|
||||
|
||||
let setFrontendAsLoaded;
|
||||
const frontendLoaded = new Promise(resolve => { setFrontendAsLoaded = resolve; });
|
||||
|
||||
// focused & not active node can happen during multiselection where the node is selected but not activated
|
||||
// (its content is not displayed in the detail)
|
||||
function getFocusedNode() {
|
||||
|
@ -362,6 +365,8 @@ async function treeInitialized() {
|
|||
// previous opening triggered task to save tab changes but these are bogus changes (this is init)
|
||||
// so we'll cancel it
|
||||
noteDetailService.clearOpenTabsTask();
|
||||
|
||||
setFrontendAsLoaded();
|
||||
}
|
||||
|
||||
let ignoreNextActivationNoteId = null;
|
||||
|
@ -817,6 +822,8 @@ $collapseTreeButton.click(() => collapseTree());
|
|||
$createTopLevelNoteButton.click(createNewTopLevelNote);
|
||||
$scrollToActiveNoteButton.click(scrollToActiveNote);
|
||||
|
||||
frontendLoaded.then(bundle.executeStartupBundles);
|
||||
|
||||
export default {
|
||||
reload,
|
||||
collapseTree,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<div class="note-detail-search note-detail-component">
|
||||
<div style="display: flex; align-items: center; margin-right: 20px;">
|
||||
<div style="display: flex; align-items: center; margin-right: 20px; margin-top: 15px;">
|
||||
<strong>Search string: </strong>
|
||||
<textarea rows="4" style="width: auto !important; flex-grow: 4" class="search-string form-control"></textarea>
|
||||
|
||||
|
|
Loading…
Reference in a new issue