From 1175a8ee496f71b3927b8a7e94d632db94a70f5b Mon Sep 17 00:00:00 2001 From: zadam Date: Wed, 8 Apr 2020 10:19:15 +0200 Subject: [PATCH] display last noteId in the note path widget as well --- src/public/javascripts/widgets/basic_widget.js | 4 +++- src/public/javascripts/widgets/note_paths.js | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/public/javascripts/widgets/basic_widget.js b/src/public/javascripts/widgets/basic_widget.js index c8812ef1b..4b5a7dc34 100644 --- a/src/public/javascripts/widgets/basic_widget.js +++ b/src/public/javascripts/widgets/basic_widget.js @@ -56,7 +56,9 @@ class BasicWidget extends Component { for (const key in this.attrs) { if (key === 'style') { - $widget.attr(key, $widget.attr('style') + ';' + this.attrs[key]); + if (this.attrs[key]) { + $widget.attr(key, $widget.attr('style') + ';' + this.attrs[key]); + } } else { $widget.attr(key, this.attrs[key]); diff --git a/src/public/javascripts/widgets/note_paths.js b/src/public/javascripts/widgets/note_paths.js index a945aacb0..8801c93ff 100644 --- a/src/public/javascripts/widgets/note_paths.js +++ b/src/public/javascripts/widgets/note_paths.js @@ -61,8 +61,7 @@ export default class NotePathsWidget extends TabAwareWidget { } async refreshWithNote(note, notePath) { - let noteIdsPath = treeService.parseNotePath(notePath); - noteIdsPath = noteIdsPath.slice(0, noteIdsPath.length - 1); + const noteIdsPath = treeService.parseNotePath(notePath); this.$currentPath.empty();