OnBuilder
Extends:
Builder → OnBuilder
The on builder. Its goal is to provide a way to listen events coming from the custom element.
Constructor Summary
Public Constructor | ||
public |
constructor(events: string) |
Method Summary
Public Methods | ||
public |
To attach the event on the capture phase insteadof of on the bubble phase. |
|
public |
To delegate the event. |
|
public |
To do something when events occurred. |
|
public |
To prevent the default behavior. |
|
public |
To prevent the default behavior and to stop the event propagation. |
|
public |
To stop the event propagation. |
Inherited Summary
From class Builder | ||
public |
To specify the logic of the builder. |
Public Constructors
Public Methods
public capture(): OnBuilder source
To attach the event on the capture phase insteadof of on the bubble phase.
public delegate(selector: string): OnBuilder source
To delegate the event.
Params:
Name | Type | Attribute | Description |
selector | string |
|
the selector |
public invoke(fn: function(el: HTMLElement, evt: DOMEvent, target: HTMLElement)): OnBuilder source
To do something when events occurred. The target argument is by default the custom element. When the delegate feature is used, target is the matched element.
Params:
Name | Type | Attribute | Description |
fn | function(el: HTMLElement, evt: DOMEvent, target: HTMLElement) |
|
the event's logic |