Classes
Methods
(static) dispatch(element, name, params)
Dispatch event.
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
element |
HTMLElement | node events |
||||||||||||||||||||
name |
string | event name |
||||||||||||||||||||
params |
Object | the event parameters Properties
|
- Source:
Example
import { dispatch } from 'xblocks-core/event';
dispatch(node, 'custom-event', {
bubbles: true,
cancelable: true,
detail: { data: '123' }
})
(static) forwardingEvents(name, fromElement, toElement, captureopt) → {function}
Forwarding events
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
name |
string | event name |
||
fromElement |
HTMLElement | |||
toElement |
HTMLElement | |||
capture |
boolean |
<optional> |
false |
- Source:
Returns:
callback
- Type
- function
Example
import { forwardingEvents } from 'xblocks-core/event';
forwardingEvents('custom-event', fromNode, toNode, false);