TinyMCE 5 webinar: Q1 review, migration tips, roadmap —  Visit the blog
TinyMCE 5 webinar : Visit the blog

tinymce.editor.mode

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.editor.mode

Methods

name summary defined by
activate() Handler to activate this mode, called before deactivating the previous mode. tinymce.editor.mode
deactivate() Handler to deactivate this mode, called after activating the new mode. tinymce.editor.mode
get() tinymce.editor.mode
isReadOnly() tinymce.editor.mode
register() Registers a new editor mode. tinymce.editor.mode
set() Sets the editor mode. Mode can be for example "design", "code" or "readonly". tinymce.editor.mode

Methods

activate

activate()

Handler to activate this mode, called before deactivating the previous mode.

deactivate

deactivate()

Handler to deactivate this mode, called after activating the new mode.

get

get():String

Return value
  • String - The active editor mode.

isReadOnly

isReadOnly():Boolean

Return value
  • Boolean - true if the editor is in a readonly state.

register

register(api:ModeApi)

Registers a new editor mode.

Parameters
  • api (ModeApi) - Activation and Deactivation API for the new mode.

set

set(mode:String)

Sets the editor mode. Mode can be for example "design", "code" or "readonly".

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.