mirror of
https://github.com/zadam/trilium.git
synced 2025-01-15 03:27:44 +08:00
awaiting on triggered events/commands in the frontend API, fixes #3799
This commit is contained in:
parent
d100b0dc07
commit
c44be53673
1 changed files with 4 additions and 4 deletions
|
@ -65,7 +65,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||||
await ws.waitForMaxKnownEntityChangeId();
|
await ws.waitForMaxKnownEntityChangeId();
|
||||||
|
|
||||||
await appContext.tabManager.getActiveContext().setNote(notePath);
|
await appContext.tabManager.getActiveContext().setNote(notePath);
|
||||||
appContext.triggerEvent('focusAndSelectTitle');
|
await appContext.triggerEvent('focusAndSelectTitle');
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -82,7 +82,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||||
await appContext.tabManager.openContextWithNote(notePath, { activate });
|
await appContext.tabManager.openContextWithNote(notePath, { activate });
|
||||||
|
|
||||||
if (activate) {
|
if (activate) {
|
||||||
appContext.triggerEvent('focusAndSelectTitle');
|
await appContext.triggerEvent('focusAndSelectTitle');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -100,10 +100,10 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||||
const subContexts = appContext.tabManager.getActiveContext().getSubContexts();
|
const subContexts = appContext.tabManager.getActiveContext().getSubContexts();
|
||||||
const {ntxId} = subContexts[subContexts.length - 1];
|
const {ntxId} = subContexts[subContexts.length - 1];
|
||||||
|
|
||||||
appContext.triggerCommand("openNewNoteSplit", {ntxId, notePath});
|
await appContext.triggerCommand("openNewNoteSplit", {ntxId, notePath});
|
||||||
|
|
||||||
if (activate) {
|
if (activate) {
|
||||||
appContext.triggerEvent('focusAndSelectTitle');
|
await appContext.triggerEvent('focusAndSelectTitle');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue