fix(ribbon): formatting toolbar displayed in read-only notes

This commit is contained in:
Elian Doran
2025-11-09 20:03:43 +02:00
parent 8589f7f164
commit 532df6559a
4 changed files with 41 additions and 15 deletions

View File

@@ -21,7 +21,9 @@ export const RIBBON_TAB_DEFINITIONS: TabConfiguration[] = [
{
title: t("classic_editor_toolbar.title"),
icon: "bx bx-text",
show: ({ note }) => note?.type === "text" && options.get("textNoteEditorType") === "ckeditor-classic",
show: async ({ note, noteContext }) => note?.type === "text"
&& options.get("textNoteEditorType") === "ckeditor-classic"
&& !(await noteContext?.isReadOnly()),
toggleCommand: "toggleRibbonTabClassicEditor",
content: FormattingToolbar,
activate: true,