diff --git a/src/public/javascripts/services/note_detail_code.js b/src/public/javascripts/services/note_detail_code.js index 243b17a32..d692ffccd 100644 --- a/src/public/javascripts/services/note_detail_code.js +++ b/src/public/javascripts/services/note_detail_code.js @@ -71,7 +71,10 @@ class NoteDetailCode { show() { this.$component.show(); - this.codeEditor.refresh(); + + if (this.codeEditor) { // show can be called before render + this.codeEditor.refresh(); + } } getContent() { diff --git a/src/public/javascripts/services/sidebar.js b/src/public/javascripts/services/sidebar.js index 739819e61..e8fc7f19c 100644 --- a/src/public/javascripts/services/sidebar.js +++ b/src/public/javascripts/services/sidebar.js @@ -106,6 +106,7 @@ class Sidebar { } } + // update at once to reduce flickering this.$widgetContainer.empty().append(...widgetsToAppend); } diff --git a/src/public/javascripts/services/tab_context.js b/src/public/javascripts/services/tab_context.js index fcd881cda..f9719e03e 100644 --- a/src/public/javascripts/services/tab_context.js +++ b/src/public/javascripts/services/tab_context.js @@ -426,7 +426,7 @@ class TabContext { for (const parentNote of parents) { const parentNotePath = await treeService.getSomeNotePath(parentNote); // this is to avoid having root notes leading '/' - const notePath = parentNotePath ? (parentNotePath + '/' + this.noteId) : this.noteId; + const notePath = parentNotePath ? (parentNotePath + '/' + this.note.noteId) : this.note.noteId; const isCurrent = activeNoteParentNoteId === parentNote.noteId; await this.addPath(notePath, isCurrent);