core_block/events

Description:
  • Javascript events for the core_block subsystem.

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

Javascript events for the core_block subsystem.

Example

Example of listening to a block event.

import {eventTypes as blockEventTypes} from 'core_block/events';

document.addEventListener(blockEventTypes.blockContentUpdated, e => {
    window.console.log(e.target); // The HTMLElement relating to the block whose content was updated.
    window.console.log(e.detail.instanceId); // The instanceId of the block that was updated.
});

Members

(static, constant) eventTypes

Description:
  • Events for core_block.

Source:
Properties:
Name Type Description
blockContentUpdated String

See event:blockContentUpdated

Events for core_block.

Methods

(inner) notifyBlockContentUpdated(element) → {CustomEvent}

Description:
  • Trigger an event to indicate that the content of a block was updated.

Source:
Parameters:
Name Type Description
element HTMLElement

The HTMLElement containing the updated block.

Fires:
Returns:
Type
CustomEvent

Events

blockContentUpdated

Description:
  • An event triggered when the content of a block has changed.

Source:
Properties:
Name Type Description
target HTMLElement

The block element that was updated

detail object
Properties
Name Type Description
instanceId number

The block instance id

Type:
  • CustomEvent