Event Class
Defines the Event-Class, which should be instantiated to get its functionality
Copyright (c) 2014 ITSA - https://github.com/itsa New BSD License - http://choosealicense.com/licenses/bsd-3-clause/
Item Index
Methods
- _addMultiSubs static
- _addMultiSubs static
- _addMultiSubs static
- _addSubscriber static
- _addSubscriber static
- _addSubscriber static
- _domCallback
- _invokeSubs
- _invokeSubs
- _invokeSubs
- _removeSubscriber static
- _removeSubscriber static
- _removeSubscriber static
- _removeSubscriber static
- _removeSubscriber static
- _removeSubscriber static
- _setEventObjProperty
- _setEventObjProperty
- _setEventObjProperty
- after static
- after static
- after static
- before static
- before static
- before static
- defineEmitter static
- defineEmitter static
- defineEmitter static
- defineEvent static
- defineEvent static
- defineEvent static
- detach static
- detach static
- detach static
- detachAll static
- detachAll static
- detachAll static
- emit static
- emit static
- emit static
- emit static
- emit static
- emit static
- hasParent
- noDeepDomEvt
- notify static
- notify static
- notify static
- notifyDetach static
- notifyDetach static
- notifyDetach static
- onceAfter static
- onceAfter static
- onceAfter static
- onceBefore static
- onceBefore static
- onceBefore static
- undefAllEvents static
- undefAllEvents static
- undefAllEvents static
- undefEvent static
- undefEvent static
- undefEvent static
- unNotify static
- unNotify static
- unNotify static
- unNotifyDetach static
- unNotifyDetach static
- unNotifyDetach static
Properties
Methods
_addMultiSubs
-
before
-
customEvent
-
callback
-
listener
-
[filter]
-
[prepend=false]
Creates a subscriber to the specified customEvent. The customEvent must conform the syntax:
emitterName:eventName
. Wildcard *
may be used for both emitterName
as well as eventName
If emitterName
is not defined, UI
is assumed.
Examples of valid customevents:
- 'redmodel:save'
- 'UI:tap'
- 'tap' --> alias for 'UI:tap'
- '
*
:click' --> careful: will listen to both UIs and non-UI- click-events - 'redmodel:
*
' - '
*
:*
'
Parameters:
-
before
Booleanwhether the subscriber is a
before
subscriber. On falsy, anafter
-subscriber is assumed. -
customEvent
ArrayArray of Strings. customEvent should conform the syntax:
emitterName:eventName
, wildcard*
may be used for bothemitterName
as well as onlyeventName
, in which case 'UI' will become the emitterName. -
callback
Functionsubscriber to the event.
-
listener
ObjectObject that creates the subscriber (and will be listening by
listener.after(...)
) -
[filter]
String | Function optionalto filter the event. Use a String if you want to filter DOM-events by a
selector
Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets theeventobject
as its only argument and the context is the subscriber. -
[prepend=false]
Boolean optionalwhether to make the subscriber the first in the list. By default it will pe appended.
Returns:
handler with a detach()
-method which can be used to detach the subscriber
_addMultiSubs
-
before
-
customEvent
-
callback
-
listener
-
[filter]
-
[prepend=false]
Creates a subscriber to the specified customEvent. The customEvent must conform the syntax:
emitterName:eventName
. Wildcard *
may be used for both emitterName
as well as eventName
If emitterName
is not defined, UI
is assumed.
Examples of valid customevents:
- 'redmodel:save'
- 'UI:tap'
- 'tap' --> alias for 'UI:tap'
- '
*
:click' --> careful: will listen to both UIs and non-UI- click-events - 'redmodel:
*
' - '
*
:*
'
Parameters:
-
before
Booleanwhether the subscriber is a
before
subscriber. On falsy, anafter
-subscriber is assumed. -
customEvent
ArrayArray of Strings. customEvent should conform the syntax:
emitterName:eventName
, wildcard*
may be used for bothemitterName
as well as onlyeventName
, in which case 'UI' will become the emitterName. -
callback
Functionsubscriber to the event.
-
listener
ObjectObject that creates the subscriber (and will be listening by
listener.after(...)
) -
[filter]
String | Function optionalto filter the event. Use a String if you want to filter DOM-events by a
selector
Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets theeventobject
as its only argument and the context is the subscriber. -
[prepend=false]
Boolean optionalwhether to make the subscriber the first in the list. By default it will pe appended.
Returns:
handler with a detach()
-method which can be used to detach the subscriber
_addMultiSubs
-
before
-
customEvent
-
callback
-
listener
-
[filter]
-
[prepend=false]
Creates a subscriber to the specified customEvent. The customEvent must conform the syntax:
emitterName:eventName
. Wildcard *
may be used for both emitterName
as well as eventName
If emitterName
is not defined, UI
is assumed.
Examples of valid customevents:
- 'redmodel:save'
- 'UI:tap'
- 'tap' --> alias for 'UI:tap'
- '
*
:click' --> careful: will listen to both UIs and non-UI- click-events - 'redmodel:
*
' - '
*
:*
'
Parameters:
-
before
Booleanwhether the subscriber is a
before
subscriber. On falsy, anafter
-subscriber is assumed. -
customEvent
ArrayArray of Strings. customEvent should conform the syntax:
emitterName:eventName
, wildcard*
may be used for bothemitterName
as well as onlyeventName
, in which case 'UI' will become the emitterName. -
callback
Functionsubscriber to the event.
-
listener
ObjectObject that creates the subscriber (and will be listening by
listener.after(...)
) -
[filter]
String | Function optionalto filter the event. Use a String if you want to filter DOM-events by a
selector
Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets theeventobject
as its only argument and the context is the subscriber. -
[prepend=false]
Boolean optionalwhether to make the subscriber the first in the list. By default it will pe appended.
Returns:
handler with a detach()
-method which can be used to detach the subscriber
_addSubscriber
-
listener
-
before
-
customEvent
-
callback
-
[filter]
-
[prepend=false]
Creates a subscriber to the specified customEvent. The customEvent must conform the syntax:
emitterName:eventName
. Wildcard *
may be used for both emitterName
as well as eventName
If emitterName
is not defined, UI
is assumed.
Examples of valid customevents:
- 'redmodel:save'
- 'UI:tap'
- 'tap' --> alias for 'UI:tap'
- '
*
:click' --> careful: will listen to both UIs and non-UI- click-events - 'redmodel:
*
' - '
*
:*
'
Parameters:
-
listener
ObjectObject that creates the subscriber (and will be listening by
listener.after(...)
) -
before
Booleanwhether the subscriber is a
before
subscriber. On falsy, anafter
-subscriber is assumed. -
customEvent
Stringconform the syntax:
emitterName:eventName
, wildcard*
may be used for bothemitterName
as well as onlyeventName
, in which case 'UI' will become the emitterName. -
callback
Functionsubscriber to the event.
-
[filter]
String | Function optionalto filter the event. Use a String if you want to filter DOM-events by a
selector
Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets theeventobject
as its only argument and the context is the subscriber. -
[prepend=false]
Boolean optionalwhether to make the subscriber the first in the list. By default it will pe appended.
Returns:
handler with a detach()
-method which can be used to detach the subscriber
_addSubscriber
-
listener
-
before
-
customEvent
-
callback
-
[filter]
-
[prepend=false]
Creates a subscriber to the specified customEvent. The customEvent must conform the syntax:
emitterName:eventName
. Wildcard *
may be used for both emitterName
as well as eventName
If emitterName
is not defined, UI
is assumed.
Examples of valid customevents:
- 'redmodel:save'
- 'UI:tap'
- 'tap' --> alias for 'UI:tap'
- '
*
:click' --> careful: will listen to both UIs and non-UI- click-events - 'redmodel:
*
' - '
*
:*
'
Parameters:
-
listener
ObjectObject that creates the subscriber (and will be listening by
listener.after(...)
) -
before
Booleanwhether the subscriber is a
before
subscriber. On falsy, anafter
-subscriber is assumed. -
customEvent
Stringconform the syntax:
emitterName:eventName
, wildcard*
may be used for bothemitterName
as well as onlyeventName
, in which case 'UI' will become the emitterName. -
callback
Functionsubscriber to the event.
-
[filter]
String | Function optionalto filter the event. Use a String if you want to filter DOM-events by a
selector
Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets theeventobject
as its only argument and the context is the subscriber. -
[prepend=false]
Boolean optionalwhether to make the subscriber the first in the list. By default it will pe appended.
Returns:
handler with a detach()
-method which can be used to detach the subscriber
_addSubscriber
-
listener
-
before
-
customEvent
-
callback
-
[filter]
-
[prepend=false]
Creates a subscriber to the specified customEvent. The customEvent must conform the syntax:
emitterName:eventName
. Wildcard *
may be used for both emitterName
as well as eventName
If emitterName
is not defined, UI
is assumed.
Examples of valid customevents:
- 'redmodel:save'
- 'UI:tap'
- 'tap' --> alias for 'UI:tap'
- '
*
:click' --> careful: will listen to both UIs and non-UI- click-events - 'redmodel:
*
' - '
*
:*
'
Parameters:
-
listener
ObjectObject that creates the subscriber (and will be listening by
listener.after(...)
) -
before
Booleanwhether the subscriber is a
before
subscriber. On falsy, anafter
-subscriber is assumed. -
customEvent
Stringconform the syntax:
emitterName:eventName
, wildcard*
may be used for bothemitterName
as well as onlyeventName
, in which case 'UI' will become the emitterName. -
callback
Functionsubscriber to the event.
-
[filter]
String | Function optionalto filter the event. Use a String if you want to filter DOM-events by a
selector
Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets theeventobject
as its only argument and the context is the subscriber. -
[prepend=false]
Boolean optionalwhether to make the subscriber the first in the list. By default it will pe appended.
Returns:
handler with a detach()
-method which can be used to detach the subscriber
_domCallback
-
eventName
-
e
Does the actual transportation from DOM-events into the Eventsystem. It also looks at the response of the Eventsystem: on e.halt() or e.preventDefault(), the original DOM-event will be preventDefaulted.
_invokeSubs
-
e
-
[checkFilter]
-
[before]
-
[checkFilter]
-
subscribers
Does the actual invocation of a subscriber.
Parameters:
-
e
Objectevent-object
-
[checkFilter]
Boolean optional -
[before]
Boolean optionalwhether it concerns before subscribers
-
[checkFilter]
Boolean optional -
subscribers
Arraycontains subscribers (objects) with these members:
- subscriber.o {Object} context of the callback
- subscriber.cb {Function} callback to be invoked
- subscriber.f {Function} filter to be applied
- subscriber.t {DOM-node} target for the specific selector, which will be set as e.target only when event-dom is active and there are filter-selectors
- subscriber.n {DOM-node} highest dom-node that acts as the container for delegation. only when event-dom is active and there are filter-selectors
- subscriber.s {Boolean} true when the subscription was set to itself by using "this:eventName"
_invokeSubs
-
e
-
[checkFilter]
-
[before]
-
[checkFilter]
-
subscribers
Does the actual invocation of a subscriber.
Parameters:
-
e
Objectevent-object
-
[checkFilter]
Boolean optional -
[before]
Boolean optionalwhether it concerns before subscribers
-
[checkFilter]
Boolean optional -
subscribers
Arraycontains subscribers (objects) with these members:
- subscriber.o {Object} context of the callback
- subscriber.cb {Function} callback to be invoked
- subscriber.f {Function} filter to be applied
- subscriber.t {DOM-node} target for the specific selector, which will be set as e.target only when event-dom is active and there are filter-selectors
- subscriber.n {DOM-node} highest dom-node that acts as the container for delegation. only when event-dom is active and there are filter-selectors
- subscriber.s {Boolean} true when the subscription was set to itself by using "this:eventName"
_invokeSubs
-
e
-
[checkFilter]
-
[before]
-
[checkFilter]
-
subscribers
Does the actual invocation of a subscriber.
Parameters:
-
e
Objectevent-object
-
[checkFilter]
Boolean optional -
[before]
Boolean optionalwhether it concerns before subscribers
-
[checkFilter]
Boolean optional -
subscribers
Arraycontains subscribers (objects) with these members:
- subscriber.o {Object} context of the callback
- subscriber.cb {Function} callback to be invoked
- subscriber.f {Function} filter to be applied
- subscriber.t {DOM-node} target for the specific selector, which will be set as e.target only when event-dom is active and there are filter-selectors
- subscriber.n {DOM-node} highest dom-node that acts as the container for delegation. only when event-dom is active and there are filter-selectors
- subscriber.s {Boolean} true when the subscription was set to itself by using "this:eventName"
_removeSubscriber
-
listener
-
customEvent
Removes subscribers from the multiple customevents. The customEvent must conform the syntax:
emitterName:eventName
. Wildcard *
may be used for both emitterName
as well as eventName
If emitterName
is not defined, UI
is assumed.
Examples of valid customevents:
- 'redmodel:save'
- 'UI:tap'
- 'tap' --> alias for 'UI:tap'
- '
*
:click' --> careful: will listen to both UIs and non-UI- click-events - 'redmodel:
*
' - '
*
:*
'
_removeSubscriber
-
listener
-
customEvent
Removes subscribers from the multiple customevents. The customEvent must conform the syntax:
emitterName:eventName
. Wildcard *
may be used for both emitterName
as well as eventName
If emitterName
is not defined, UI
is assumed.
Examples of valid customevents:
- 'redmodel:save'
- 'UI:tap'
- 'tap' --> alias for 'UI:tap'
- '
*
:click' --> careful: will listen to both UIs and non-UI- click-events - 'redmodel:
*
' - '
*
:*
'
_removeSubscriber
-
listener
-
before
-
customEvent
-
[callback]
Removes a subscriber from the specified customEvent. The customEvent must conform the syntax:
emitterName:eventName
.
Parameters:
-
listener
ObjectObject that creates the subscriber (and will be listening by
listener.after(...)
) -
before
Booleanwhether the subscriber is a
before
subscriber. On falsy, anafter
-subscriber is assumed. -
customEvent
Stringconform the syntax:
emitterName:eventName
, wildcard*
may be used for bothemitterName
as well as onlyeventName
, in which case 'UI' will become the emmiterName. -
[callback]
Function optionalsubscriber to the event, when not set, all subscribers of the listener to this customEvent will be removed.
_removeSubscriber
-
listener
-
before
-
customEvent
-
[callback]
Removes a subscriber from the specified customEvent. The customEvent must conform the syntax:
emitterName:eventName
.
Parameters:
-
listener
ObjectObject that creates the subscriber (and will be listening by
listener.after(...)
) -
before
Booleanwhether the subscriber is a
before
subscriber. On falsy, anafter
-subscriber is assumed. -
customEvent
Stringconform the syntax:
emitterName:eventName
, wildcard*
may be used for bothemitterName
as well as onlyeventName
, in which case 'UI' will become the emmiterName. -
[callback]
Function optionalsubscriber to the event, when not set, all subscribers of the listener to this customEvent will be removed.
_removeSubscriber
-
listener
-
before
-
customEvent
-
[callback]
Removes a subscriber from the specified customEvent. The customEvent must conform the syntax:
emitterName:eventName
.
Parameters:
-
listener
ObjectObject that creates the subscriber (and will be listening by
listener.after(...)
) -
before
Booleanwhether the subscriber is a
before
subscriber. On falsy, anafter
-subscriber is assumed. -
customEvent
Stringconform the syntax:
emitterName:eventName
, wildcard*
may be used for bothemitterName
as well as onlyeventName
, in which case 'UI' will become the emmiterName. -
[callback]
Function optionalsubscriber to the event, when not set, all subscribers of the listener to this customEvent will be removed.
_removeSubscriber
-
listener
-
customEvent
Removes subscribers from the multiple customevents. The customEvent must conform the syntax:
emitterName:eventName
. Wildcard *
may be used for both emitterName
as well as eventName
If emitterName
is not defined, UI
is assumed.
Examples of valid customevents:
- 'redmodel:save'
- 'UI:tap'
- 'tap' --> alias for 'UI:tap'
- '
*
:click' --> careful: will listen to both UIs and non-UI- click-events - 'redmodel:
*
' - '
*
:*
'
_setEventObjProperty
-
property
-
value
Adds a property to the default eventobject's prototype which passes through all eventcycles. Goes through Object.defineProperty with configurable, enumerable and writable all set to false.
Parameters:
-
property
Stringevent-object
-
value
Any
_setEventObjProperty
-
property
-
value
Adds a property to the default eventobject's prototype which passes through all eventcycles. Goes through Object.defineProperty with configurable, enumerable and writable all set to false.
Parameters:
-
property
Stringevent-object
-
value
Any
_setEventObjProperty
-
property
-
value
Adds a property to the default eventobject's prototype which passes through all eventcycles. Goes through Object.defineProperty with configurable, enumerable and writable all set to false.
Parameters:
-
property
Stringevent-object
-
value
Any
after
-
customEvent
-
callback
-
[context]
-
[filter]
-
[prepend=false]
Subscribes to a customEvent. The callback will be executed after
the defaultFn.
Parameters:
-
customEvent
String | Arraythe custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax:
emitterName:eventName
. Wildcard*
may be used for bothemitterName
as well aseventName
. IfemitterName
is not defined,UI
is assumed. -
callback
Functionsubscriber:will be invoked when the event occurs. An
eventobject
will be passed as its only argument. -
[context]
Object optionalthe instance that subscribes to the event. any object can passed through, even those are not extended with event-listener methods. Note: Objects who are extended with listener-methods should use instance.after() instead.
-
[filter]
String | Function optionalto filter the event. Use a String if you want to filter DOM-events by a
selector
Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets theeventobject
as its only argument and the context is the subscriber. -
[prepend=false]
Boolean optionalwhether the subscriber should be the first in the list of after-subscribers.
Returns:
handler with a detach()
-method which can be used to detach the subscriber
after
-
customEvent
-
callback
-
[context]
-
[filter]
-
[prepend=false]
Subscribes to a customEvent. The callback will be executed after
the defaultFn.
Parameters:
-
customEvent
String | Arraythe custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax:
emitterName:eventName
. Wildcard*
may be used for bothemitterName
as well aseventName
. IfemitterName
is not defined,UI
is assumed. -
callback
Functionsubscriber:will be invoked when the event occurs. An
eventobject
will be passed as its only argument. -
[context]
Object optionalthe instance that subscribes to the event. any object can passed through, even those are not extended with event-listener methods. Note: Objects who are extended with listener-methods should use instance.after() instead.
-
[filter]
String | Function optionalto filter the event. Use a String if you want to filter DOM-events by a
selector
Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets theeventobject
as its only argument and the context is the subscriber. -
[prepend=false]
Boolean optionalwhether the subscriber should be the first in the list of after-subscribers.
Returns:
handler with a detach()
-method which can be used to detach the subscriber
after
-
customEvent
-
callback
-
[context]
-
[filter]
-
[prepend=false]
Subscribes to a customEvent. The callback will be executed after
the defaultFn.
Parameters:
-
customEvent
String | Arraythe custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax:
emitterName:eventName
. Wildcard*
may be used for bothemitterName
as well aseventName
. IfemitterName
is not defined,UI
is assumed. -
callback
Functionsubscriber:will be invoked when the event occurs. An
eventobject
will be passed as its only argument. -
[context]
Object optionalthe instance that subscribes to the event. any object can passed through, even those are not extended with event-listener methods. Note: Objects who are extended with listener-methods should use instance.after() instead.
-
[filter]
String | Function optionalto filter the event. Use a String if you want to filter DOM-events by a
selector
Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets theeventobject
as its only argument and the context is the subscriber. -
[prepend=false]
Boolean optionalwhether the subscriber should be the first in the list of after-subscribers.
Returns:
handler with a detach()
-method which can be used to detach the subscriber
before
-
customEvent
-
callback
-
[context]
-
[filter]
-
[prepend=false]
Subscribes to a customEvent. The callback will be executed before
the defaultFn.
Parameters:
-
customEvent
String | Arraythe custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax:
emitterName:eventName
. Wildcard*
may be used for bothemitterName
as well aseventName
. IfemitterName
is not defined,UI
is assumed. -
callback
Functionsubscriber:will be invoked when the event occurs. An
eventobject
will be passed as its only argument. -
[context]
Object optionalthe instance that subscribes to the event. any object can passed through, even those are not extended with event-listener methods. Note: Objects who are extended with listener-methods should use instance.before() instead.
-
[filter]
String | Function optionalto filter the event. Use a String if you want to filter DOM-events by a
selector
Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets theeventobject
as its only argument and the context is the subscriber. -
[prepend=false]
Boolean optionalwhether the subscriber should be the first in the list of before-subscribers.
Returns:
handler with a detach()
-method which can be used to detach the subscriber
before
-
customEvent
-
callback
-
[context]
-
[filter]
-
[prepend=false]
Subscribes to a customEvent. The callback will be executed before
the defaultFn.
Parameters:
-
customEvent
String | Arraythe custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax:
emitterName:eventName
. Wildcard*
may be used for bothemitterName
as well aseventName
. IfemitterName
is not defined,UI
is assumed. -
callback
Functionsubscriber:will be invoked when the event occurs. An
eventobject
will be passed as its only argument. -
[context]
Object optionalthe instance that subscribes to the event. any object can passed through, even those are not extended with event-listener methods. Note: Objects who are extended with listener-methods should use instance.before() instead.
-
[filter]
String | Function optionalto filter the event. Use a String if you want to filter DOM-events by a
selector
Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets theeventobject
as its only argument and the context is the subscriber. -
[prepend=false]
Boolean optionalwhether the subscriber should be the first in the list of before-subscribers.
Returns:
handler with a detach()
-method which can be used to detach the subscriber
before
-
customEvent
-
callback
-
[context]
-
[filter]
-
[prepend=false]
Subscribes to a customEvent. The callback will be executed before
the defaultFn.
Parameters:
-
customEvent
String | Arraythe custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax:
emitterName:eventName
. Wildcard*
may be used for bothemitterName
as well aseventName
. IfemitterName
is not defined,UI
is assumed. -
callback
Functionsubscriber:will be invoked when the event occurs. An
eventobject
will be passed as its only argument. -
[context]
Object optionalthe instance that subscribes to the event. any object can passed through, even those are not extended with event-listener methods. Note: Objects who are extended with listener-methods should use instance.before() instead.
-
[filter]
String | Function optionalto filter the event. Use a String if you want to filter DOM-events by a
selector
Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets theeventobject
as its only argument and the context is the subscriber. -
[prepend=false]
Boolean optionalwhether the subscriber should be the first in the list of before-subscribers.
Returns:
handler with a detach()
-method which can be used to detach the subscriber
defineEmitter
-
emitter
-
emitterName
Defines an emitterName into the instance (emitter).
This will add a protected property _emitterName
to the instance.
defineEmitter
-
emitter
-
emitterName
Defines an emitterName into the instance (emitter).
This will add a protected property _emitterName
to the instance.
defineEmitter
-
emitter
-
emitterName
Defines an emitterName into the instance (emitter).
This will add a protected property _emitterName
to the instance.
defineEvent
-
customEvent
Defines a CustomEvent. If the eventtype already exists, it will not be overridden,
unless you force to assign with .forceAssign()
The returned object comes with 8 methods which can be invoked chainable:
- defaultFn() --> the default-function of the event
- preventedFn() --> the function that should be invoked when the event is defaultPrevented
- forceAssign() --> overrides any previous definition
- unHaltable() --> makes the customEvent cannot be halted
- unPreventable() --> makes the customEvent's defaultFn cannot be prevented
- unSilencable() --> makes that emitters cannot make this event to perform silently (using e.silent)
Parameters:
-
customEvent
Stringname of the customEvent conform the syntax:
emitterName:eventName
Returns:
with extra methods that can be chained:
- unPreventable() --> makes the customEvent's defaultFn cannot be prevented
- forceAssign() --> overrides any previous definition
- defaultFn() --> the default-function of the event
- preventedFn() --> the function that should be invoked when the event is defaultPrevented
- forceAssign() --> overrides any previous definition
- unHaltable() --> makes the customEvent cannot be halted
- unSilencable() --> makes that emitters cannot make this event to perform silently (using e.silent)
defineEvent
-
customEvent
Defines a CustomEvent. If the eventtype already exists, it will not be overridden,
unless you force to assign with .forceAssign()
The returned object comes with 8 methods which can be invoked chainable:
- defaultFn() --> the default-function of the event
- preventedFn() --> the function that should be invoked when the event is defaultPrevented
- forceAssign() --> overrides any previous definition
- unHaltable() --> makes the customEvent cannot be halted
- unPreventable() --> makes the customEvent's defaultFn cannot be prevented
- unSilencable() --> makes that emitters cannot make this event to perform silently (using e.silent)
Parameters:
-
customEvent
Stringname of the customEvent conform the syntax:
emitterName:eventName
Returns:
with extra methods that can be chained:
- unPreventable() --> makes the customEvent's defaultFn cannot be prevented
- forceAssign() --> overrides any previous definition
- defaultFn() --> the default-function of the event
- preventedFn() --> the function that should be invoked when the event is defaultPrevented
- forceAssign() --> overrides any previous definition
- unHaltable() --> makes the customEvent cannot be halted
- unSilencable() --> makes that emitters cannot make this event to perform silently (using e.silent)
defineEvent
-
customEvent
Defines a CustomEvent. If the eventtype already exists, it will not be overridden,
unless you force to assign with .forceAssign()
The returned object comes with 8 methods which can be invoked chainable:
- defaultFn() --> the default-function of the event
- preventedFn() --> the function that should be invoked when the event is defaultPrevented
- forceAssign() --> overrides any previous definition
- unHaltable() --> makes the customEvent cannot be halted
- unPreventable() --> makes the customEvent's defaultFn cannot be prevented
- unSilencable() --> makes that emitters cannot make this event to perform silently (using e.silent)
Parameters:
-
customEvent
Stringname of the customEvent conform the syntax:
emitterName:eventName
Returns:
with extra methods that can be chained:
- unPreventable() --> makes the customEvent's defaultFn cannot be prevented
- forceAssign() --> overrides any previous definition
- defaultFn() --> the default-function of the event
- preventedFn() --> the function that should be invoked when the event is defaultPrevented
- forceAssign() --> overrides any previous definition
- unHaltable() --> makes the customEvent cannot be halted
- unSilencable() --> makes that emitters cannot make this event to perform silently (using e.silent)
detach
-
[listener]
-
customEvent
Detaches (unsubscribes) the listener from the specified customEvent.
Parameters:
-
[listener]
Object optionalThe instance that is going to detach the customEvent. When not passed through (or undefined), all customevents of all instances are detached
-
customEvent
Stringconform the syntax:
emitterName:eventName
, wildcard*
may be used for bothemitterName
as well as onlyeventName
, in which case 'UI' will become the emitterName. Can be set as the only argument.
detach
-
[listener]
-
customEvent
Detaches (unsubscribes) the listener from the specified customEvent.
Parameters:
-
[listener]
Object optionalThe instance that is going to detach the customEvent. When not passed through (or undefined), all customevents of all instances are detached
-
customEvent
Stringconform the syntax:
emitterName:eventName
, wildcard*
may be used for bothemitterName
as well as onlyeventName
, in which case 'UI' will become the emitterName. Can be set as the only argument.
detach
-
[listener]
-
customEvent
Detaches (unsubscribes) the listener from the specified customEvent.
Parameters:
-
[listener]
Object optionalThe instance that is going to detach the customEvent. When not passed through (or undefined), all customevents of all instances are detached
-
customEvent
Stringconform the syntax:
emitterName:eventName
, wildcard*
may be used for bothemitterName
as well as onlyeventName
, in which case 'UI' will become the emitterName. Can be set as the only argument.
detachAll
-
listener
Detaches (unsubscribes) the listener from all customevents.
Parameters:
-
listener
ObjectThe instance that is going to detach the customEvent
detachAll
-
listener
Detaches (unsubscribes) the listener from all customevents.
Parameters:
-
listener
ObjectThe instance that is going to detach the customEvent
detachAll
-
listener
Detaches (unsubscribes) the listener from all customevents.
Parameters:
-
listener
ObjectThe instance that is going to detach the customEvent
emit
-
[emitter]
-
customEvent
-
payload
-
[beforeSubscribers]
-
[afterSubscribers]
-
[preProcessor]
-
[keepPayload=false]
-
[payloadGetters]
Emits the event eventName
on behalf of emitter
, which becomes e.target in the eventobject.
During this process, all subscribers and the defaultFn/preventedFn get an eventobject passed through.
The eventobject is created with at least these properties:
- e.target --> source that triggered the event (instance or DOM-node), specified by
emitter
- e.type --> eventName
- e.emitter --> emitterName
- e.status --> status-information:
- e.status.ok -->
true|false
whether the event got executed (not halted or defaultPrevented) - e.status.defaultFn (optional) -->
true
if any defaultFn got invoked - e.status.preventedFn (optional) -->
true
if any preventedFn got invoked - e.status.halted (optional) -->
reason|true
if the event got halted and optional the why - e.status.defaultPrevented (optional) -->
reason|true
if the event got defaultPrevented and optional the why
- e.status.ok -->
The optional payload
is merged into the eventobject and could be used by the subscribers and the defaultFn/preventedFn.
If payload.silent is set true, the subscribers are not getting invoked: only the defaultFn.
The eventobject also has these methods:
- e.halt() --> stops immediate all actions: no mer subscribers are invoked, no defaultFn/preventedFn
- e.preventDefault() --> instead of invoking defaultFn, preventedFn will be invoked. No aftersubscribers
- First, before-subscribers are invoked: this is the place where you might call
e.halt()
ora.preventDefault()
- Next, defaultFn or preventedFn gets invoked, depending on whether e.halt() or a.preventDefault() has been called
- Finally, after-subscribers get invoked (unless e.halt() or a.preventDefault() has been called)
Parameters:
-
[emitter]
Object optionalinstance that emits the events
-
customEvent
StringFull customEvent conform syntax
emitterName:eventName
.emitterName
is available as e.emitter,eventName
as e.type. -
payload
Objectextra payload to be added to the event-object
-
[beforeSubscribers]
Array optionalarray of functions to act as beforesubscribers. should not be used other than by any submodule like
event-dom
. If used, than this list of subscribers gets invoked instead of the subscribers that actually subscribed to the event. -
[afterSubscribers]
Array optionalarray of functions to act as afterSubscribers. should not be used other than by any submodule like
event-dom
. If used, than this list of subscribers gets invoked instead of the subscribers that actually subscribed to the event. -
[preProcessor]
Function optionalif passed, this function will be invoked before every single subscriber It is meant to manipulate the eventobject, something that
event-dom
needs to do This function expects 2 arguments:subscriber
andeventobject
. should not be used other than by any submodule likeevent-dom
. -
[keepPayload=false]
Boolean optionalwhether
payload
should be used as the ventobject instead of creating a new eventobject and merge payload. should not be used other than by any submodule likeevent-dom
. -
[payloadGetters]
Object optionaladditional payload, where getters inside
payload
are defined as object-values this might be needed, in cae thepayload
has getters that you need to maintain (getters onpayload
are ignored)
Returns:
eventobject or undefined when the event was halted or preventDefaulted.
emit
-
[emitter]
-
customEvent
-
payload
Emits the event eventName
on behalf of emitter
, which becomes e.target in the eventobject.
During this process, all subscribers and the defaultFn/preventedFn get an eventobject passed through.
The eventobject is created with at least these properties:
- e.target --> source that triggered the event (instance or DOM-node), specified by
emitter
- e.type --> eventName
- e.emitter --> emitterName
- e.status --> status-information:
- e.status.ok -->
true|false
whether the event got executed (not halted or defaultPrevented) - e.status.defaultFn (optional) -->
true
if any defaultFn got invoked - e.status.preventedFn (optional) -->
true
if any preventedFn got invoked - e.status.halted (optional) -->
reason|true
if the event got halted and optional the why - e.status.defaultPrevented (optional) -->
reason|true
if the event got defaultPrevented and optional the why
- e.status.ok -->
The optional payload
is merged into the eventobject and could be used by the subscribers and the defaultFn/preventedFn.
If payload.silent is set true, the subscribers are not getting invoked: only the defaultFn.
The eventobject also has these methods:
- e.halt() --> stops immediate all actions: no mer subscribers are invoked, no defaultFn/preventedFn
- e.preventDefault() --> instead of invoking defaultFn, preventedFn will be invoked. No aftersubscribers
- First, before-subscribers are invoked: this is the place where you might call
e.halt()
,a.preventDefault()
- Next, defaultFn or preventedFn gets invoked, depending on whether e.halt() or a.preventDefault() has been called
- Finally, after-subscribers get invoked (unless e.halt() or a.preventDefault() has been called)
Parameters:
Returns:
eventobject or undefined when the event was halted or preventDefaulted.
emit
-
[emitter]
-
customEvent
-
payload
Emits the event eventName
on behalf of emitter
, which becomes e.target in the eventobject.
During this process, all subscribers and the defaultFn/preventedFn get an eventobject passed through.
The eventobject is created with at least these properties:
- e.target --> source that triggered the event (instance or DOM-node), specified by
emitter
- e.type --> eventName
- e.emitter --> emitterName
- e.status --> status-information:
- e.status.ok -->
true|false
whether the event got executed (not halted or defaultPrevented) - e.status.defaultFn (optional) -->
true
if any defaultFn got invoked - e.status.preventedFn (optional) -->
true
if any preventedFn got invoked - e.status.halted (optional) -->
reason|true
if the event got halted and optional the why - e.status.defaultPrevented (optional) -->
reason|true
if the event got defaultPrevented and optional the why
- e.status.ok -->
The optional payload
is merged into the eventobject and could be used by the subscribers and the defaultFn/preventedFn.
If payload.silent is set true, the subscribers are not getting invoked: only the defaultFn.
The eventobject also has these methods:
- e.halt() --> stops immediate all actions: no mer subscribers are invoked, no defaultFn/preventedFn
- e.preventDefault() --> instead of invoking defaultFn, preventedFn will be invoked. No aftersubscribers
- First, before-subscribers are invoked: this is the place where you might call
e.halt()
,a.preventDefault()
- Next, defaultFn or preventedFn gets invoked, depending on whether e.halt() or a.preventDefault() has been called
- Finally, after-subscribers get invoked (unless e.halt() or a.preventDefault() has been called)
Parameters:
Returns:
eventobject or undefined when the event was halted or preventDefaulted.
emit
-
[emitter]
-
customEvent
-
payload
-
[beforeSubscribers]
-
[afterSubscribers]
-
[preProcessor]
-
[keepPayload=false]
-
[payloadGetters]
Emits the event eventName
on behalf of emitter
, which becomes e.target in the eventobject.
During this process, all subscribers and the defaultFn/preventedFn get an eventobject passed through.
The eventobject is created with at least these properties:
- e.target --> source that triggered the event (instance or DOM-node), specified by
emitter
- e.type --> eventName
- e.emitter --> emitterName
- e.status --> status-information:
- e.status.ok -->
true|false
whether the event got executed (not halted or defaultPrevented) - e.status.defaultFn (optional) -->
true
if any defaultFn got invoked - e.status.preventedFn (optional) -->
true
if any preventedFn got invoked - e.status.halted (optional) -->
reason|true
if the event got halted and optional the why - e.status.defaultPrevented (optional) -->
reason|true
if the event got defaultPrevented and optional the why
- e.status.ok -->
The optional payload
is merged into the eventobject and could be used by the subscribers and the defaultFn/preventedFn.
If payload.silent is set true, the subscribers are not getting invoked: only the defaultFn.
The eventobject also has these methods:
- e.halt() --> stops immediate all actions: no mer subscribers are invoked, no defaultFn/preventedFn
- e.preventDefault() --> instead of invoking defaultFn, preventedFn will be invoked. No aftersubscribers
- First, before-subscribers are invoked: this is the place where you might call
e.halt()
ora.preventDefault()
- Next, defaultFn or preventedFn gets invoked, depending on whether e.halt() or a.preventDefault() has been called
- Finally, after-subscribers get invoked (unless e.halt() or a.preventDefault() has been called)
Parameters:
-
[emitter]
Object optionalinstance that emits the events
-
customEvent
StringFull customEvent conform syntax
emitterName:eventName
.emitterName
is available as e.emitter,eventName
as e.type. -
payload
Objectextra payload to be added to the event-object
-
[beforeSubscribers]
Array optionalarray of functions to act as beforesubscribers. should not be used other than by any submodule like
event-dom
. If used, than this list of subscribers gets invoked instead of the subscribers that actually subscribed to the event. -
[afterSubscribers]
Array optionalarray of functions to act as afterSubscribers. should not be used other than by any submodule like
event-dom
. If used, than this list of subscribers gets invoked instead of the subscribers that actually subscribed to the event. -
[preProcessor]
Function optionalif passed, this function will be invoked before every single subscriber It is meant to manipulate the eventobject, something that
event-dom
needs to do This function expects 2 arguments:subscriber
andeventobject
. should not be used other than by any submodule likeevent-dom
. -
[keepPayload=false]
Boolean optionalwhether
payload
should be used as the ventobject instead of creating a new eventobject and merge payload. should not be used other than by any submodule likeevent-dom
. -
[payloadGetters]
Object optionaladditional payload, where getters inside
payload
are defined as object-values this might be needed, in cae thepayload
has getters that you need to maintain (getters onpayload
are ignored)
Returns:
eventobject or undefined when the event was halted or preventDefaulted.
emit
-
[emitter]
-
customEvent
-
payload
-
[beforeSubscribers]
-
[afterSubscribers]
-
[preProcessor]
-
[keepPayload=false]
-
[payloadGetters]
Emits the event eventName
on behalf of emitter
, which becomes e.target in the eventobject.
During this process, all subscribers and the defaultFn/preventedFn get an eventobject passed through.
The eventobject is created with at least these properties:
- e.target --> source that triggered the event (instance or DOM-node), specified by
emitter
- e.type --> eventName
- e.emitter --> emitterName
- e.status --> status-information:
- e.status.ok -->
true|false
whether the event got executed (not halted or defaultPrevented) - e.status.defaultFn (optional) -->
true
if any defaultFn got invoked - e.status.preventedFn (optional) -->
true
if any preventedFn got invoked - e.status.halted (optional) -->
reason|true
if the event got halted and optional the why - e.status.defaultPrevented (optional) -->
reason|true
if the event got defaultPrevented and optional the why
- e.status.ok -->
The optional payload
is merged into the eventobject and could be used by the subscribers and the defaultFn/preventedFn.
If payload.silent is set true, the subscribers are not getting invoked: only the defaultFn.
The eventobject also has these methods:
- e.halt() --> stops immediate all actions: no mer subscribers are invoked, no defaultFn/preventedFn
- e.preventDefault() --> instead of invoking defaultFn, preventedFn will be invoked. No aftersubscribers
- First, before-subscribers are invoked: this is the place where you might call
e.halt()
ora.preventDefault()
- Next, defaultFn or preventedFn gets invoked, depending on whether e.halt() or a.preventDefault() has been called
- Finally, after-subscribers get invoked (unless e.halt() or a.preventDefault() has been called)
Parameters:
-
[emitter]
Object optionalinstance that emits the events
-
customEvent
StringFull customEvent conform syntax
emitterName:eventName
.emitterName
is available as e.emitter,eventName
as e.type. -
payload
Objectextra payload to be added to the event-object
-
[beforeSubscribers]
Array optionalarray of functions to act as beforesubscribers. should not be used other than by any submodule like
event-dom
. If used, than this list of subscribers gets invoked instead of the subscribers that actually subscribed to the event. -
[afterSubscribers]
Array optionalarray of functions to act as afterSubscribers. should not be used other than by any submodule like
event-dom
. If used, than this list of subscribers gets invoked instead of the subscribers that actually subscribed to the event. -
[preProcessor]
Function optionalif passed, this function will be invoked before every single subscriber It is meant to manipulate the eventobject, something that
event-dom
needs to do This function expects 2 arguments:subscriber
andeventobject
. should not be used other than by any submodule likeevent-dom
. -
[keepPayload=false]
Boolean optionalwhether
payload
should be used as the ventobject instead of creating a new eventobject and merge payload. should not be used other than by any submodule likeevent-dom
. -
[payloadGetters]
Object optionaladditional payload, where getters inside
payload
are defined as object-values this might be needed, in cae thepayload
has getters that you need to maintain (getters onpayload
are ignored)
Returns:
eventobject or undefined when the event was halted or preventDefaulted.
emit
-
[emitter]
-
customEvent
-
payload
Emits the event eventName
on behalf of emitter
, which becomes e.target in the eventobject.
During this process, all subscribers and the defaultFn/preventedFn get an eventobject passed through.
The eventobject is created with at least these properties:
- e.target --> source that triggered the event (instance or DOM-node), specified by
emitter
- e.type --> eventName
- e.emitter --> emitterName
- e.status --> status-information:
- e.status.ok -->
true|false
whether the event got executed (not halted or defaultPrevented) - e.status.defaultFn (optional) -->
true
if any defaultFn got invoked - e.status.preventedFn (optional) -->
true
if any preventedFn got invoked - e.status.halted (optional) -->
reason|true
if the event got halted and optional the why - e.status.defaultPrevented (optional) -->
reason|true
if the event got defaultPrevented and optional the why
- e.status.ok -->
The optional payload
is merged into the eventobject and could be used by the subscribers and the defaultFn/preventedFn.
If payload.silent is set true, the subscribers are not getting invoked: only the defaultFn.
The eventobject also has these methods:
- e.halt() --> stops immediate all actions: no mer subscribers are invoked, no defaultFn/preventedFn
- e.preventDefault() --> instead of invoking defaultFn, preventedFn will be invoked. No aftersubscribers
- First, before-subscribers are invoked: this is the place where you might call
e.halt()
,a.preventDefault()
- Next, defaultFn or preventedFn gets invoked, depending on whether e.halt() or a.preventDefault() has been called
- Finally, after-subscribers get invoked (unless e.halt() or a.preventDefault() has been called)
Parameters:
Returns:
eventobject or undefined when the event was halted or preventDefaulted.
hasParent
-
node
-
parent
find if a node is in the given parent
Parameters:
-
node
HTMLElement -
parent
HTMLElement
Returns:
found
noDeepDomEvt
-
domEvent
-
e
notify
-
customEvent
-
callback
-
context
-
[once=false]
Creates a notifier for the customEvent.
You can use this to create delayed defineEvents
. When the customEvent is called, the callback gets invoked
(even before the subsrcibers). Use this callback for delayed customEvent-definitions.
You may use wildcards for both emitterName and eventName.
You must specify the full emitterName:eventName
syntax.
The module core-event-dom
uses notify
to auto-define DOM-events (UI:*).
Parameters:
-
customEvent
String | Arraythe custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax:
emitterName:eventName
. Wildcard*
may be used only foreventName
. IfemitterName
should be defined. -
callback
Functionsubscriber: will be invoked when the customEvent is called (before any subscribers. Recieves 2 arguments: the
customEvent
andsubscriber-object
. -
context
Objectcontext of the callback
-
[once=false]
Boolean optionalwhether the subscriptions should be removed after the first invokation
notify
-
customEvent
-
callback
-
context
-
[once=false]
Creates a notifier for the customEvent.
You can use this to create delayed defineEvents
. When the customEvent is called, the callback gets invoked
(even before the subsrcibers). Use this callback for delayed customEvent-definitions.
You may use wildcards for both emitterName and eventName.
You must specify the full emitterName:eventName
syntax.
The module core-event-dom
uses notify
to auto-define DOM-events (UI:*).
Parameters:
-
customEvent
String | Arraythe custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax:
emitterName:eventName
. Wildcard*
may be used only foreventName
. IfemitterName
should be defined. -
callback
Functionsubscriber: will be invoked when the customEvent is called (before any subscribers. Recieves 2 arguments: the
customEvent
andsubscriber-object
. -
context
Objectcontext of the callback
-
[once=false]
Boolean optionalwhether the subscriptions should be removed after the first invokation
notify
-
customEvent
-
callback
-
context
-
[once=false]
Creates a notifier for the customEvent.
You can use this to create delayed defineEvents
. When the customEvent is called, the callback gets invoked
(even before the subsrcibers). Use this callback for delayed customEvent-definitions.
You may use wildcards for both emitterName and eventName.
You must specify the full emitterName:eventName
syntax.
The module core-event-dom
uses notify
to auto-define DOM-events (UI:*).
Parameters:
-
customEvent
String | Arraythe custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax:
emitterName:eventName
. Wildcard*
may be used only foreventName
. IfemitterName
should be defined. -
callback
Functionsubscriber: will be invoked when the customEvent is called (before any subscribers. Recieves 2 arguments: the
customEvent
andsubscriber-object
. -
context
Objectcontext of the callback
-
[once=false]
Boolean optionalwhether the subscriptions should be removed after the first invokation
notifyDetach
-
customEvent
-
callback
-
context
-
[once=false]
Creates a detach-notifier for the customEvent. You can use this to get informed whenever a subscriber detaches.
Use no wildcards for the emitterName. You might use wildcards for the eventName. Without wildcards, the notification will be unNotified (callback automaticly detached) on the first time the event occurs.
You must specify the full emitterName:eventName
syntax.
The module core-event-dom
uses notify
to auto-define DOM-events (UI:*).
Parameters:
-
customEvent
String | Arraythe custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax:
emitterName:eventName
. Wildcard*
may be used only foreventName
. IfemitterName
should be defined. -
callback
Functionsubscriber: will be invoked when the customEvent is called (before any subscribers. Recieves 1 arguments: the
customEvent
. -
context
Objectcontext of the callback
-
[once=false]
Boolean optionalwhether the subscriptions should be removed after the first invokation
notifyDetach
-
customEvent
-
callback
-
context
-
[once=false]
Creates a detach-notifier for the customEvent. You can use this to get informed whenever a subscriber detaches.
Use no wildcards for the emitterName. You might use wildcards for the eventName. Without wildcards, the notification will be unNotified (callback automaticly detached) on the first time the event occurs.
You must specify the full emitterName:eventName
syntax.
The module core-event-dom
uses notify
to auto-define DOM-events (UI:*).
Parameters:
-
customEvent
String | Arraythe custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax:
emitterName:eventName
. Wildcard*
may be used only foreventName
. IfemitterName
should be defined. -
callback
Functionsubscriber: will be invoked when the customEvent is called (before any subscribers. Recieves 1 arguments: the
customEvent
. -
context
Objectcontext of the callback
-
[once=false]
Boolean optionalwhether the subscriptions should be removed after the first invokation
notifyDetach
-
customEvent
-
callback
-
context
-
[once=false]
Creates a detach-notifier for the customEvent. You can use this to get informed whenever a subscriber detaches.
Use no wildcards for the emitterName. You might use wildcards for the eventName. Without wildcards, the notification will be unNotified (callback automaticly detached) on the first time the event occurs.
You must specify the full emitterName:eventName
syntax.
The module core-event-dom
uses notify
to auto-define DOM-events (UI:*).
Parameters:
-
customEvent
String | Arraythe custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax:
emitterName:eventName
. Wildcard*
may be used only foreventName
. IfemitterName
should be defined. -
callback
Functionsubscriber: will be invoked when the customEvent is called (before any subscribers. Recieves 1 arguments: the
customEvent
. -
context
Objectcontext of the callback
-
[once=false]
Boolean optionalwhether the subscriptions should be removed after the first invokation
onceAfter
-
customEvent
-
callback
-
[context]
-
[filter]
-
[prepend=false]
Subscribes to a customEvent. The callback will be executed after
the defaultFn.
The subscriber will be automaticly removed once the callback executed the first time.
No need to detach()
(unless you want to undescribe before the first event)
Parameters:
-
customEvent
String | Arraythe custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax:
emitterName:eventName
. Wildcard*
may be used for bothemitterName
as well aseventName
. IfemitterName
is not defined,UI
is assumed. -
callback
Functionsubscriber:will be invoked when the event occurs. An
eventobject
will be passed as its only argument. -
[context]
Object optionalthe instance that subscribes to the event. any object can passed through, even those are not extended with event-listener methods. Note: Objects who are extended with listener-methods should use instance.onceAfter() instead.
-
[filter]
String | Function optionalto filter the event. Use a String if you want to filter DOM-events by a
selector
Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets theeventobject
as its only argument and the context is the subscriber. -
[prepend=false]
Boolean optionalwhether the subscriber should be the first in the list of after-subscribers.
Returns:
handler with a detach()
-method which can be used to detach the subscriber
onceAfter
-
customEvent
-
callback
-
[context]
-
[filter]
-
[prepend=false]
Subscribes to a customEvent. The callback will be executed after
the defaultFn.
The subscriber will be automaticly removed once the callback executed the first time.
No need to detach()
(unless you want to undescribe before the first event)
Parameters:
-
customEvent
String | Arraythe custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax:
emitterName:eventName
. Wildcard*
may be used for bothemitterName
as well aseventName
. IfemitterName
is not defined,UI
is assumed. -
callback
Functionsubscriber:will be invoked when the event occurs. An
eventobject
will be passed as its only argument. -
[context]
Object optionalthe instance that subscribes to the event. any object can passed through, even those are not extended with event-listener methods. Note: Objects who are extended with listener-methods should use instance.onceAfter() instead.
-
[filter]
String | Function optionalto filter the event. Use a String if you want to filter DOM-events by a
selector
Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets theeventobject
as its only argument and the context is the subscriber. -
[prepend=false]
Boolean optionalwhether the subscriber should be the first in the list of after-subscribers.
Returns:
handler with a detach()
-method which can be used to detach the subscriber
onceAfter
-
customEvent
-
callback
-
[context]
-
[filter]
-
[prepend=false]
Subscribes to a customEvent. The callback will be executed after
the defaultFn.
The subscriber will be automaticly removed once the callback executed the first time.
No need to detach()
(unless you want to undescribe before the first event)
Parameters:
-
customEvent
String | Arraythe custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax:
emitterName:eventName
. Wildcard*
may be used for bothemitterName
as well aseventName
. IfemitterName
is not defined,UI
is assumed. -
callback
Functionsubscriber:will be invoked when the event occurs. An
eventobject
will be passed as its only argument. -
[context]
Object optionalthe instance that subscribes to the event. any object can passed through, even those are not extended with event-listener methods. Note: Objects who are extended with listener-methods should use instance.onceAfter() instead.
-
[filter]
String | Function optionalto filter the event. Use a String if you want to filter DOM-events by a
selector
Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets theeventobject
as its only argument and the context is the subscriber. -
[prepend=false]
Boolean optionalwhether the subscriber should be the first in the list of after-subscribers.
Returns:
handler with a detach()
-method which can be used to detach the subscriber
onceBefore
-
customEvent
-
callback
-
[context]
-
[filter]
-
[prepend=false]
Subscribes to a customEvent. The callback will be executed before
the defaultFn.
The subscriber will be automaticly removed once the callback executed the first time.
No need to detach()
(unless you want to undescribe before the first event)
Parameters:
-
customEvent
String | Arraythe custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax:
emitterName:eventName
. Wildcard*
may be used for bothemitterName
as well aseventName
. IfemitterName
is not defined,UI
is assumed. -
callback
Functionsubscriber:will be invoked when the event occurs. An
eventobject
will be passed as its only argument. -
[context]
Object optionalthe instance that subscribes to the event. any object can passed through, even those are not extended with event-listener methods. Note: Objects who are extended with listener-methods should use instance.onceBefore() instead.
-
[filter]
String | Function optionalto filter the event. Use a String if you want to filter DOM-events by a
selector
Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets theeventobject
as its only argument and the context is the subscriber. -
[prepend=false]
Boolean optionalwhether the subscriber should be the first in the list of before-subscribers.
Returns:
handler with a detach()
-method which can be used to detach the subscriber
onceBefore
-
customEvent
-
callback
-
[context]
-
[filter]
-
[prepend=false]
Subscribes to a customEvent. The callback will be executed before
the defaultFn.
The subscriber will be automaticly removed once the callback executed the first time.
No need to detach()
(unless you want to undescribe before the first event)
Parameters:
-
customEvent
String | Arraythe custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax:
emitterName:eventName
. Wildcard*
may be used for bothemitterName
as well aseventName
. IfemitterName
is not defined,UI
is assumed. -
callback
Functionsubscriber:will be invoked when the event occurs. An
eventobject
will be passed as its only argument. -
[context]
Object optionalthe instance that subscribes to the event. any object can passed through, even those are not extended with event-listener methods. Note: Objects who are extended with listener-methods should use instance.onceBefore() instead.
-
[filter]
String | Function optionalto filter the event. Use a String if you want to filter DOM-events by a
selector
Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets theeventobject
as its only argument and the context is the subscriber. -
[prepend=false]
Boolean optionalwhether the subscriber should be the first in the list of before-subscribers.
Returns:
handler with a detach()
-method which can be used to detach the subscriber
onceBefore
-
customEvent
-
callback
-
[context]
-
[filter]
-
[prepend=false]
Subscribes to a customEvent. The callback will be executed before
the defaultFn.
The subscriber will be automaticly removed once the callback executed the first time.
No need to detach()
(unless you want to undescribe before the first event)
Parameters:
-
customEvent
String | Arraythe custom-event (or Array of events) to subscribe to. CustomEvents should have the syntax:
emitterName:eventName
. Wildcard*
may be used for bothemitterName
as well aseventName
. IfemitterName
is not defined,UI
is assumed. -
callback
Functionsubscriber:will be invoked when the event occurs. An
eventobject
will be passed as its only argument. -
[context]
Object optionalthe instance that subscribes to the event. any object can passed through, even those are not extended with event-listener methods. Note: Objects who are extended with listener-methods should use instance.onceBefore() instead.
-
[filter]
String | Function optionalto filter the event. Use a String if you want to filter DOM-events by a
selector
Use a function if you want to filter by any other means. If the function returns a trully value, the subscriber gets invoked. The function gets theeventobject
as its only argument and the context is the subscriber. -
[prepend=false]
Boolean optionalwhether the subscriber should be the first in the list of before-subscribers.
Returns:
handler with a detach()
-method which can be used to detach the subscriber
undefAllEvents
-
[emitterName]
Removes all event-definitions of an emitter, specified by its emitterName
.
When emitterName
is not set, ALL event-definitions will be removed.
Parameters:
-
[emitterName]
String optionalname of the customEvent conform the syntax:
emitterName:eventName
undefAllEvents
-
[emitterName]
Removes all event-definitions of an emitter, specified by its emitterName
.
When emitterName
is not set, ALL event-definitions will be removed.
Parameters:
-
[emitterName]
String optionalname of the customEvent conform the syntax:
emitterName:eventName
undefAllEvents
-
[emitterName]
Removes all event-definitions of an emitter, specified by its emitterName
.
When emitterName
is not set, ALL event-definitions will be removed.
Parameters:
-
[emitterName]
String optionalname of the customEvent conform the syntax:
emitterName:eventName
undefEvent
-
customEvent
Removes the event-definition of the specified customEvent.
Parameters:
-
customEvent
Stringname of the customEvent conform the syntax:
emitterName:eventName
undefEvent
-
customEvent
Removes the event-definition of the specified customEvent.
Parameters:
-
customEvent
Stringname of the customEvent conform the syntax:
emitterName:eventName
undefEvent
-
customEvent
Removes the event-definition of the specified customEvent.
Parameters:
-
customEvent
Stringname of the customEvent conform the syntax:
emitterName:eventName
unNotify
-
customEvent
unNotifies (unsubscribes) the notifier of the specified customEvent.
Parameters:
-
customEvent
Stringconform the syntax:
emitterName:eventName
.
unNotify
-
customEvent
unNotifies (unsubscribes) the notifier of the specified customEvent.
Parameters:
-
customEvent
Stringconform the syntax:
emitterName:eventName
.
unNotify
-
customEvent
unNotifies (unsubscribes) the notifier of the specified customEvent.
Parameters:
-
customEvent
Stringconform the syntax:
emitterName:eventName
.
unNotifyDetach
-
customEvent
unNotifies (unsubscribes) the detach-notifier of the specified customEvent.
Parameters:
-
customEvent
Stringconform the syntax:
emitterName:eventName
.
unNotifyDetach
-
customEvent
unNotifies (unsubscribes) the detach-notifier of the specified customEvent.
Parameters:
-
customEvent
Stringconform the syntax:
emitterName:eventName
.
unNotifyDetach
-
customEvent
unNotifies (unsubscribes) the detach-notifier of the specified customEvent.
Parameters:
-
customEvent
Stringconform the syntax:
emitterName:eventName
.
Properties
_ce
Object
private
Objecthash containing all defined before and after subscribers
which has a structure like this (b
represents before
and a
represents after
)
Every item that gets in the array consist by itself of 3 properties:
subscriberitem = {
o: listener,
cb: callbackFn(e),
f: filter
};
_subs = { 'UI:tap': { b: [ item, item ], a: [ item, item ] }, '*:click': { b: [ item, item ], a: [ item, item ] }, 'redmodel:save': { b: [ item, item ], a: [ item, item ] } }
Default: {}
_ce
Object
private
Objecthash containing all defined custom-events which has a structure like this:
_ce = { 'UI:tap': { preventable: true, defaultFn: function(){...}, preventedFn: function(){...} }, 'redmodel:save': { preventable: true, defaultFn: function(){...}, preventedFn: function(){...} } }
Default: {}
_ce
Object
private
Objecthash containing all defined before and after subscribers
which has a structure like this (b
represents before
and a
represents after
)
Every item that gets in the array consist by itself of 3 properties:
subscriberitem = {
o: listener,
cb: callbackFn(e),
f: filter
};
_subs = { 'UI:tap': { b: [ item, item ], a: [ item, item ] }, '*:click': { b: [ item, item ], a: [ item, item ] }, 'redmodel:save': { b: [ item, item ], a: [ item, item ] } }
Default: {}
_ce
Object
private
Objecthash containing all defined before and after subscribers
which has a structure like this (b
represents before
and a
represents after
)
Every item that gets in the array consist by itself of 3 properties:
subscriberitem = {
o: listener,
cb: callbackFn(e),
f: filter
};
_subs = { 'UI:tap': { b: [ item, item ], a: [ item, item ] }, '*:click': { b: [ item, item ], a: [ item, item ] }, 'redmodel:save': { b: [ item, item ], a: [ item, item ] } }
Default: {}
_ce
Object
private
Objecthash containing all defined custom-events which has a structure like this:
_ce = { 'UI:tap': { preventable: true, defaultFn: function(){...}, preventedFn: function(){...} }, 'redmodel:save': { preventable: true, defaultFn: function(){...}, preventedFn: function(){...} } }
Default: {}
_ce
Object
private
Objecthash containing all defined custom-events which has a structure like this:
_ce = { 'UI:tap': { preventable: true, defaultFn: function(){...}, preventedFn: function(){...} }, 'redmodel:save': { preventable: true, defaultFn: function(){...}, preventedFn: function(){...} } }
Default: {}
_defaultEventObj
Object
private
Object that acts as the prototype of the eventobject.
To add more methods, you can use _setEventObjProperty
Default: { halt: function(), preventDefault: function() }
_defaultEventObj
Object
private
Object that acts as the prototype of the eventobject.
To add more methods, you can use _setEventObjProperty
Default: { halt: function(), preventDefault: function() }
_defaultEventObj
Object
private
Object that acts as the prototype of the eventobject.
To add more methods, you can use _setEventObjProperty
Default: { halt: function(), preventDefault: function() }
_detachNotifiers
Object
private
Objecthash containing all detach-notifiers, keyed by customEvent name.
This list is maintained by notifyDetach
and unNotifyDetach
_detachNotifiers = { 'UI:tap': { cb:function() {} o: {} // context }, 'redmodel:*': { cb:function() {} o: {} // context }, 'bluemodel:save': { cb:function() {} o: {} // context } }
Default: {}
_detachNotifiers
Object
private
Objecthash containing all detach-notifiers, keyed by customEvent name.
This list is maintained by notifyDetach
and unNotifyDetach
_detachNotifiers = { 'UI:tap': { cb:function() {} o: {} // context }, 'redmodel:*': { cb:function() {} o: {} // context }, 'bluemodel:save': { cb:function() {} o: {} // context } }
Default: {}
_detachNotifiers
Object
private
Objecthash containing all detach-notifiers, keyed by customEvent name.
This list is maintained by notifyDetach
and unNotifyDetach
_detachNotifiers = { 'UI:tap': { cb:function() {} o: {} // context }, 'redmodel:*': { cb:function() {} o: {} // context }, 'bluemodel:save': { cb:function() {} o: {} // context } }
Default: {}
_notifiers
Object
private
Objecthash containing all notifiers, keyed by customEvent name.
This list is maintained by notify
and unNotify
_notifiers = { 'UI:tap': { cb:function() {} o: {} // context }, 'redmodel:*': { cb:function() {} o: {} // context }, 'bluemodel:save': { cb:function() {} o: {} // context } }
Default: {}
_notifiers
Object
private
Objecthash containing all notifiers, keyed by customEvent name.
This list is maintained by notify
and unNotify
_notifiers = { 'UI:tap': { cb:function() {} o: {} // context }, 'redmodel:*': { cb:function() {} o: {} // context }, 'bluemodel:save': { cb:function() {} o: {} // context } }
Default: {}
_notifiers
Object
private
Objecthash containing all notifiers, keyed by customEvent name.
This list is maintained by notify
and unNotify
_notifiers = { 'UI:tap': { cb:function() {} o: {} // context }, 'redmodel:*': { cb:function() {} o: {} // context }, 'bluemodel:save': { cb:function() {} o: {} // context } }
Default: {}
_runningEvents
Object
private
Objecthash containing all running Events. Meant for local registration inside _emit --> to prevent looping whenever a listener emits the same event.
Default: {}
_runningEvents
Object
private
Objecthash containing all running Events. Meant for local registration inside _emit --> to prevent looping whenever a listener emits the same event.
Default: {}
_runningEvents
Object
private
Objecthash containing all running Events. Meant for local registration inside _emit --> to prevent looping whenever a listener emits the same event.
Default: {}
Hammer
Hammer
Adds the Hammer
-class to Event, so it can be used from within Event.
hammertime
Hammer-instance
The (only) Hammer-instance that Event
uses. It is bound to the body
-element.
POLL_INTERVAL
Number
static
Interval (in milliseconds) at which to poll for changes to the value of an
element with one or more valuechange
subscribers, because of a right-click paste
which cannot be determined by the event-system
Default: 250
{string}
Unknown
final
Events
ParcelaEvent:eventmobile
Is emitted whenever hammerjs detects a gestureevent.
By emitting its original event through ParcelaEvent:eventmobile, event-dom
will catch it and process it through the dom-event cycle.
Event Payload:
-
e
Objecteventobject