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 name
  • sub <null|string> - the sub-event
  • namespace <null|string> - event namespace
  • selector <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 element
  • data <null|object> - The data that passed to the event
  • handler <function> - The handler that passed to the event.
  • conditions <array> - All the conditions passed to the event
  • jqueryElement <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 the movingThreshold while pressing then this property will be true, false otherwise.
  • movingThreshold <integer> - Maximum allowed movement before the hasMoved 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 the Pointers called when any js pointer happen.
  • pointerdown :void - Automatically triggered method when js native pointerdown happen on the element.
  • pointerup :void - Automatically triggered method when js native pointerup happen on the element.
  • pointermove :void - Automatically triggered method when js native pointermove happen on the element.
  • pointerleave :void - Automatically triggered method when js native pointerleave happen on the element.
  • pointercancel :void - Automatically triggered method when js native pointercancel happen on the element.
  • pointerenter :void - Automatically triggered method when js native pointerenter happen on the element.
  • validateConditions :boolean - Validate the external conditions passed to the event.
  • distance :integer - Calculate the distance between the startingCoordinates and the argument, you must make sure that startingCoordinates 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.