From 15e21b0bdf161aceea6aeac38e2cd5c5fe8c263a Mon Sep 17 00:00:00 2001 From: Nathan Leiby Date: Wed, 2 Oct 2019 16:07:58 -0700 Subject: [PATCH] Desktop: Resolves #1896: Hide some toolbar buttons when editor hidden (#1940) addresses issue: https://github.com/laurent22/joplin/issues/1896 --- ElectronClient/app/gui/NoteText.jsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ElectronClient/app/gui/NoteText.jsx b/ElectronClient/app/gui/NoteText.jsx index 43d23f58898..a27314b3782 100644 --- a/ElectronClient/app/gui/NoteText.jsx +++ b/ElectronClient/app/gui/NoteText.jsx @@ -1543,7 +1543,7 @@ class NoteTextComponent extends React.Component { menu.popup(bridge().window()); } - createToolbarItems(note) { + createToolbarItems(note, editorIsVisible) { const toolbarItems = []; if (note && this.state.folder && ['Search', 'Tag'].includes(this.props.notesParentType)) { toolbarItems.push({ @@ -1578,7 +1578,7 @@ class NoteTextComponent extends React.Component { }); } - if (note.markup_language === Note.MARKUP_LANGUAGE_MARKDOWN) { + if (note.markup_language === Note.MARKUP_LANGUAGE_MARKDOWN && editorIsVisible) { toolbarItems.push({ tooltip: _('Bold'), iconName: 'fa-bold', @@ -1980,7 +1980,8 @@ class NoteTextComponent extends React.Component { } } - const toolbarItems = this.createToolbarItems(note); + const editorIsVisible = visiblePanes.indexOf('editor') >= 0; + const toolbarItems = this.createToolbarItems(note, editorIsVisible); const toolbar = ;