isPreviewMode

Returns whether the editor is in preview mode.

Returns

TypeDescription
Booleantrue if in preview mode, false otherwise

Example

if (editor.isPreviewMode()) {
  editor.setMode('edit');
}