From 806ab22fa8cc7a0656b8fae9a8d1f8b2b5489de3 Mon Sep 17 00:00:00 2001 From: zadam Date: Wed, 27 Jan 2021 20:44:58 +0100 Subject: [PATCH] hide note paths dropdown on changed note, #1572 --- src/public/app/widgets/note_paths.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/public/app/widgets/note_paths.js b/src/public/app/widgets/note_paths.js index 6ea8e1a1b..ebf942590 100644 --- a/src/public/app/widgets/note_paths.js +++ b/src/public/app/widgets/note_paths.js @@ -59,6 +59,7 @@ export default class NotePathsWidget extends TabAwareWidget { this.$currentPath = this.$widget.find('.current-path'); this.$dropdown = this.$widget.find(".dropdown"); + this.$dropdownToggle = this.$widget.find('.dropdown-toggle'); this.$notePathList = this.$dropdown.find(".note-path-list"); @@ -100,6 +101,8 @@ export default class NotePathsWidget extends TabAwareWidget { parentNoteId = noteId; } + + this.$dropdownToggle.dropdown('hide'); } async renderDropdown() { @@ -141,20 +144,20 @@ export default class NotePathsWidget extends TabAwareWidget { async addPath(notePath, isCurrent) { const title = await treeService.getNotePathTitle(notePath); - const noteLink = await linkService.createNoteLink(notePath, {title}); + const $noteLink = await linkService.createNoteLink(notePath, {title}); - noteLink + $noteLink .addClass("dropdown-item"); - noteLink + $noteLink .find('a') .addClass("no-tooltip-preview"); if (isCurrent) { - noteLink.addClass("current"); + $noteLink.addClass("current"); } - this.$notePathList.append(noteLink); + this.$notePathList.append($noteLink); } entitiesReloadedEvent({loadResults}) {