better behavior of activateNote frontend script

This commit is contained in:
zadam
2019-08-12 22:25:42 +02:00
parent dfa1ab65c6
commit 493cd1a7e0
2 changed files with 9 additions and 5 deletions

View File

@@ -40,9 +40,13 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte
* @returns {Promise<void>}
*/
this.activateNote = async (notePath, noteLoadedListener) => {
await treeService.activateNote(notePath, noteLoadedListener);
await treeService.activateNote(notePath, async () => {
await treeService.scrollToActiveNote();
await treeService.scrollToActiveNote();
if (noteLoadedListener) {
noteLoadedListener();
}
});
};
/**