Public Method Author API

changeActivityMode()

Changes the mode (edit or preview) being used in Activity 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.changeActivityMode('preview');

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

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

Arguments

  • mode string

    Specifies the mode for changing the Activity view.

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

    Possible values:
    • "edit"
    • "preview"

Return value

boolean

Returns true if the mode change was successful, or false if unable to change the Activity mode.

Was this article helpful?