mirror of
https://github.com/zadam/trilium.git
synced 2025-10-07 22:22:44 +08:00
fix(popup_editor): classic editor toolbar displayed when it shouldn't
This commit is contained in:
parent
b595d1fade
commit
63dc5697dd
1 changed files with 13 additions and 5 deletions
|
@ -48,6 +48,18 @@ export default class ClassicEditorToolbar extends NoteContextAwareWidget {
|
||||||
this.contentSized();
|
this.contentSized();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isEnabled(): boolean | null | undefined {
|
||||||
|
if (options.get("textNoteEditorType") !== "ckeditor-classic") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.note || this.note.type !== "text") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
async getTitle() {
|
async getTitle() {
|
||||||
return {
|
return {
|
||||||
show: await this.#shouldDisplay(),
|
show: await this.#shouldDisplay(),
|
||||||
|
@ -58,11 +70,7 @@ export default class ClassicEditorToolbar extends NoteContextAwareWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
async #shouldDisplay() {
|
async #shouldDisplay() {
|
||||||
if (options.get("textNoteEditorType") !== "ckeditor-classic") {
|
if (!this.isEnabled()) {
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.note || this.note.type !== "text") {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue