From 0973498fe9c8fa861b541edf5d458c71f79ad189 Mon Sep 17 00:00:00 2001 From: zadam Date: Sun, 29 Mar 2020 20:37:40 +0200 Subject: [PATCH] small fixes --- src/public/javascripts/entities/note_short.js | 5 ++++- .../javascripts/widgets/standard_top_widget.js | 12 ++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/public/javascripts/entities/note_short.js b/src/public/javascripts/entities/note_short.js index 884f4c6b3..271bc0b3c 100644 --- a/src/public/javascripts/entities/note_short.js +++ b/src/public/javascripts/entities/note_short.js @@ -183,7 +183,10 @@ class NoteShort { if (this.noteId !== 'root') { for (const parentNote of this.getParentNotes()) { - attrArrs.push(parentNote.getInheritableAttributes()); + // these virtual parent-child relationships are also loaded into frontend tree cache + if (parentNote.type !== 'search') { + attrArrs.push(parentNote.getInheritableAttributes()); + } } } diff --git a/src/public/javascripts/widgets/standard_top_widget.js b/src/public/javascripts/widgets/standard_top_widget.js index fb3b14968..7a2137962 100644 --- a/src/public/javascripts/widgets/standard_top_widget.js +++ b/src/public/javascripts/widgets/standard_top_widget.js @@ -74,9 +74,17 @@ export default class StandardTopWidget extends BasicWidget { this.$widget.find(".jump-to-note-dialog-button").on('click', () => this.triggerCommand('jumpToNote')); this.$widget.find(".recent-changes-button").on('click', () => this.triggerCommand('showRecentChanges')); - this.$widget.find(".enter-protected-session-button").on('click', protectedSessionService.enterProtectedSession); - this.$widget.find(".leave-protected-session-button").on('click', protectedSessionService.leaveProtectedSession); + this.$enterProtectedSessionButton = this.$widget.find(".enter-protected-session-button"); + this.$enterProtectedSessionButton.on('click', protectedSessionService.enterProtectedSession); + + this.$leaveProtectedSessionButton = this.$widget.find(".leave-protected-session-button"); + this.$leaveProtectedSessionButton.on('click', protectedSessionService.leaveProtectedSession); return this.$widget } + + protectedSessionStartedEvent() { + this.$enterProtectedSessionButton.hide(); + this.$leaveProtectedSessionButton.show(); + } } \ No newline at end of file