pencil.js / base-event / BaseEvent
Class: BaseEvent<T>
Defined in: base-event.ts:4
Base event class
Extended by
Type Parameters
| Type Parameter | Default type |
|---|---|
T | unknown |
Constructors
Constructor
ts
new BaseEvent<T>(
name,
target,
event?
): BaseEvent<T>;Defined in: base-event.ts:23
BaseEvent constructor
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | Name of the event |
target | T | Component concerned by the event |
event? | Event | Original HTML event |
Returns
BaseEvent<T>
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
bubble | boolean | Should the event continue to bubble up to parents | base-event.ts:15 |
event? | Event | Original DOM event (if any) | base-event.ts:12 |
name | string | Name of the event | base-event.ts:6 |
target | T | Component concerned by the event | base-event.ts:9 |
Methods
getModifier()
ts
getModifier(): string | null;Defined in: base-event.ts:42
Get the event modifier (should be overridden by child classes)
Returns
string | null
prevent()
ts
prevent(): this;Defined in: base-event.ts:50
Prevent the initial event default behavior
Returns
this
Itself
stop()
ts
stop(): this;Defined in: base-event.ts:34
Mark this event as stopped (won't bubble further)
Returns
this
Itself
