Skip to content

Commit

Permalink
client: Hide ribbon tab when classic editor is off
Browse files Browse the repository at this point in the history
  • Loading branch information
eliandoran committed Nov 9, 2024
1 parent c421e75 commit 6e0a10c
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { t } from "../../services/i18n.js";
import options from "../../services/options.js";
import NoteContextAwareWidget from "../note_context_aware_widget.js";

const TPL = `\
Expand Down Expand Up @@ -26,6 +27,9 @@ const TPL = `\
* Handles the editing toolbar when the CKEditor is in decoupled mode.
*
* <p>
* This toolbar is only enabled if the user has selected the classic CKEditor.
*
* <p>
* The ribbon item is active by default for text notes, as long as they are not in read-only mode.
*/
export default class ClassicEditorToolbar extends NoteContextAwareWidget {
Expand All @@ -48,6 +52,10 @@ export default class ClassicEditorToolbar extends NoteContextAwareWidget {
}

async #shouldDisplay() {
if (options.get("textNoteEditorType") !== "ckeditor-classic") {
return false;
}

if (this.note.type !== "text") {
return false;
}
Expand Down

0 comments on commit 6e0a10c

Please sign in to comment.