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$pfunction -
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 themovingThresholdwhile pressing then this property will be true, false otherwise.movingThreshold<integer> - Maximum allowed movement before thehasMovedproperty 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 thePointerscalled when any js pointer happen.pointerdown:void - Automatically triggered method when js nativepointerdownhappen on the element.pointerup:void - Automatically triggered method when js nativepointeruphappen on the element.pointermove:void - Automatically triggered method when js nativepointermovehappen on the element.pointerleave:void - Automatically triggered method when js nativepointerleavehappen on the element.pointercancel:void - Automatically triggered method when js nativepointercancelhappen on the element.pointerenter:void - Automatically triggered method when js nativepointerenterhappen on the element.validateConditions:boolean - Validate the external conditions passed to the event.distance:integer - Calculate the distance between thestartingCoordinatesand the argument, you must make sure thatstartingCoordinatesis 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.