changeItemMode - Methods - Author API

Author API Methods

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

Type boolean

Returns true when the Item mode change was successful.

Returns false when unable to change the Item mode.

Was this article helpful?

Did you arrive here by accident? If so, learn more about Learnosity.