BaseEvent#
BaseEvent
is the base class for all the events, it includes the properties and methods that are common between all of them.
Properties#
name
<string> - Event namesub
<null|string> - the sub-eventnamespace
<null|string> - event namespaceselector
<null|string> - the selector that passed to event, if this is not null then the event will not trigger if this isn't the target elementdata
<null|object> - The data that passed to the eventhandler
<function> - The handler that passed to the event.conditions
<array> - All the conditions passed to the eventjqueryElement
<object> - The JQuery element of the current selector-
currentSelector
<string> - The selector that is passed as an argument to the$p
function -
currentPointers
<null|object> - All the pointers that are currently pressing on the element. startingCoordinates
<null|object> - The coordinates of where the primary pointer start pressing.firstInteractionAt
<null|integer> - The primary pointer first press time.hasMoved
<boolean> - If any of the pointers moved an amount equal or larger than themovingThreshold
while pressing then this property will be true, false otherwise.movingThreshold
<integer> - Maximum allowed movement before thehasMoved
property change to true.triggeredAt
<null|integer> - The time of when the handler is triggered.succeed
<boolean> - weather the event succeed on its main condition or not (used internally)subs
<array> - List of all the available subs for this method (must be override by the child class)
Methods#
handle
:void - This is the first method that thePointers
called when any js pointer happen.pointerdown
:void - Automatically triggered method when js nativepointerdown
happen on the element.pointerup
:void - Automatically triggered method when js nativepointerup
happen on the element.pointermove
:void - Automatically triggered method when js nativepointermove
happen on the element.pointerleave
:void - Automatically triggered method when js nativepointerleave
happen on the element.pointercancel
:void - Automatically triggered method when js nativepointercancel
happen on the element.pointerenter
:void - Automatically triggered method when js nativepointerenter
happen on the element.validateConditions
:boolean - Validate the external conditions passed to the event.distance
:integer - Calculate the distance between thestartingCoordinates
and the argument, you must make sure thatstartingCoordinates
is not null before calling this method.runIfOk
:integer - Runs the passed handler if the event succeed all the conditions.getAvailableSubs
:array - Return all the available sub-events for this event.reset
:void - reset properties to its default values
Subs#
- None.