mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-29 00:11:32 +08:00
client: Hide ribbon tab when classic editor is off
This commit is contained in:
parent
c421e75f55
commit
6e0a10cf2c
@ -1,4 +1,5 @@
|
|||||||
import { t } from "../../services/i18n.js";
|
import { t } from "../../services/i18n.js";
|
||||||
|
import options from "../../services/options.js";
|
||||||
import NoteContextAwareWidget from "../note_context_aware_widget.js";
|
import NoteContextAwareWidget from "../note_context_aware_widget.js";
|
||||||
|
|
||||||
const TPL = `\
|
const TPL = `\
|
||||||
@ -26,6 +27,9 @@ const TPL = `\
|
|||||||
* Handles the editing toolbar when the CKEditor is in decoupled mode.
|
* Handles the editing toolbar when the CKEditor is in decoupled mode.
|
||||||
*
|
*
|
||||||
* <p>
|
* <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.
|
* 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 {
|
export default class ClassicEditorToolbar extends NoteContextAwareWidget {
|
||||||
@ -48,6 +52,10 @@ export default class ClassicEditorToolbar extends NoteContextAwareWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async #shouldDisplay() {
|
async #shouldDisplay() {
|
||||||
|
if (options.get("textNoteEditorType") !== "ckeditor-classic") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.note.type !== "text") {
|
if (this.note.type !== "text") {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user