core/edit_switch

Controls the edit switch.

Source:
License:
  • http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Members

(static, constant) eventTypes

Source:
Properties:
Name Type Description
editModeSet String

See event:core/edit_switch/editModeSet

Names of events for core/edit_switch.

(static, constant) init

Source:

Add the eventlistener for the editswitch.

Methods

(protected, inner) notifyEditModeSet(container, editMode) → {CustomEvent}

Source:

Dispatch the editModeSet event after changing the edit mode.

This event is cancelable.

The default action is to reload the page after toggling the edit mode.

Parameters:
Name Type Description
container HTMLElement
editMode bool
Returns:
Type
CustomEvent

(inner) setEditMode(context, setmode) → {Promise}

Source:

Change the Edit mode.

Parameters:
Name Type Description
context number

The contextid that editing is being set for

setmode bool

Whether editing is set or not

Returns:

Resolved with an array file the stored file url.

Type
Promise

(protected, inner) toggleEditSwitch(editSwitch)

Source:

Toggle the edit switch

Parameters:
Name Type Description
editSwitch HTMLElement

Events

core/edit_switch/editModeSet

Source:
Properties:
Name Type Description
target HTMLElement

The switch used to toggle the edit mode

detail object
Properties
Name Type Description
editMode bool

An event triggered when the edit mode toggled.

Type:
  • CustomEvent