NOTE: TinyMCE 5 reached End of Support in April 2023. No more bug fixes, security updates, or new features will be introduced to TinyMCE 5. We recommend you upgrade to TinyMCE 6 or consider TinyMCE 5 Long Term Support (LTS) if you need more time.
tinymce.EditorMode
TinyMCE 5 Mode API.
Properties
name | type | summary | defined by |
---|---|---|---|
editorReadOnly | boolean | Flags whether the editor should be made readonly while this mode is active. | tinymce.EditorMode |
Methods
name | summary | defined by |
---|---|---|
activate() | Handler to activate this mode, called before deactivating the previous mode. | tinymce.EditorMode |
deactivate() | Handler to deactivate this mode, called after activating the new mode. | tinymce.EditorMode |
get() | Returns the active editor mode, such as "design" or "readonly". | tinymce.EditorMode |
isReadOnly() | Checks if the editor is in a readonly state. | tinymce.EditorMode |
register() | Registers a new editor mode. | tinymce.EditorMode |
set() | Sets the editor mode. The available modes are "design" and "readonly". Additional modes can be registered using 'register'. | tinymce.EditorMode |
Methods
activate
Handler to activate this mode, called before deactivating the previous mode.
deactivate
Handler to deactivate this mode, called after activating the new mode.
get
Returns the active editor mode, such as "design" or "readonly".
Return value
- String - The active editor mode.
isReadOnly
Checks if the editor is in a readonly state.
Return value
- Boolean - true if the editor is in a readonly state.
register
Registers a new editor mode.
Parameters
- api (EditorModeApi) - Activation and Deactivation API for the new mode.
set
Sets the editor mode. The available modes are "design" and "readonly". Additional modes can be registered using 'register'.
Parameters
- mode (String) - Mode to set the editor in.
Can't find what you're looking for? Let us know.
Except as otherwise noted, the content of this page is licensed under the Creative Commons BY-NC-SA 3.0 License, and code samples are licensed under the Apache 2.0 License.