Public Method Author API

changeItemMode()

Changes the mode (edit or preview) being used in Item editor view.

You would want to use this method so that you can allow the author to switch between modes using your own custom button, for example.

Examples

// Change to the preview mode
var result = authorApp.changeItemMode('preview');

// Change to the edit mode
var result = authorApp.changeItemMode('edit');

// Toggle between edit or preview modes
var result = authorApp.changeItemMode();

Arguments

  • mode string

    Specifies the mode for changing the Item view.

    If no value is passed, the mode will be toggled from edit to preview and vice-versa.

    Possible values:
    • edit
    • preview

Return value

  • string

    If successful, returns a string containing the new Item mode, which can be "edit" or "preview".

  • boolean

    Returns false when unable to change the Item mode.

Was this article helpful?