From ee1b377bc28fa00b9b49fb94cf4d29322b68d201 Mon Sep 17 00:00:00 2001 From: zadam Date: Thu, 21 Oct 2021 21:28:44 +0200 Subject: [PATCH] deactivate some buttons based on note type --- src/public/app/widgets/buttons/note_actions.js | 10 ++++++++-- src/public/app/widgets/note_map.js | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/public/app/widgets/buttons/note_actions.js b/src/public/app/widgets/buttons/note_actions.js index 5c62e990c..87c20d386 100644 --- a/src/public/app/widgets/buttons/note_actions.js +++ b/src/public/app/widgets/buttons/note_actions.js @@ -25,12 +25,12 @@ const TPL = ` `; @@ -42,6 +42,8 @@ export default class NoteActionsWidget extends NoteContextAwareWidget { doRender() { this.$widget = $(TPL); + this.$findInTextButton = this.$widget.find('.find-in-text-button'); + this.$printActiveNoteButton = this.$widget.find('.print-active-note-button'); this.$showSourceButton = this.$widget.find('.show-source-button'); this.$renderNoteButton = this.$widget.find('.render-note-button'); @@ -63,8 +65,12 @@ export default class NoteActionsWidget extends NoteContextAwareWidget { } refreshWithNote(note) { + this.toggleDisabled(this.$findInTextButton, ['text', 'code', 'book', 'search'].includes(note.type)); + this.toggleDisabled(this.$showSourceButton, ['text', 'relation-map', 'search', 'code'].includes(note.type)); + this.toggleDisabled(this.$printActiveNoteButton, ['text', 'code'].includes(note.type)); + this.$renderNoteButton.toggle(note.type === 'render'); this.$openNoteExternallyButton.toggle(utils.isElectron()); diff --git a/src/public/app/widgets/note_map.js b/src/public/app/widgets/note_map.js index 3f5d7bbe6..8e596a9c5 100644 --- a/src/public/app/widgets/note_map.js +++ b/src/public/app/widgets/note_map.js @@ -17,7 +17,7 @@ const TPL = `
top: 10px; right: 10px; background-color: var(--accented-background-color); - z-index: 1000; + z-index: 10; /* should be below dropdown (note actions) */ } .map-type-switcher .bx {