API Docs for: 1.0b
Show:

Events Class

Module: Events

Events Provider.

Can function either as a standalone or a Mixin

Constructor

Events

(
  • el
)

Parameters:

  • el Element

    element to use as event target. Optional

Methods

addEvent

(
  • the
  • a
)
chainable

Adds an event

Parameters:

  • the String

    event type

  • a Function

    function to add

addEventOnce

(
  • the
  • a
)
chainable

Adds an event for one execution, then removes it

Parameters:

  • the String

    event type

  • a Function

    function to add

addEvents

(
  • literal
)
chainable

Helper to add multiple events at once

Parameters:

  • literal Object

    object of event types => callbacks

Events.createEvent

(
  • type
  • dispatcher
  • args
)
private static

cross-browser function to create event object for fire method

Created object will always have following properties: - dispatcher: a reference to dispatching object (since we can't use 'this') - args: arguments passed alongside the event - object_event: a flag set to true to easily check if this is an object event or a normal DOM event.

Parameters:

  • type String
  • dispatcher Object
  • args Mixed

Returns:

event object

Events.removeOn

(
  • type
)
String static

removes the on* prefix from event names

Parameters:

  • type String

Returns:

String:

fireEvent

(
  • event
  • arguments
)
chainable

dispatches an event

Parameters:

  • event String

    type

  • arguments Mixed

    to pass with the event

fireLatchedEvent

(
  • the
  • arguments
)
chainable

Fires a latched event

Parameters:

  • the String

    event type

  • arguments Mixed

    to pass with the event

getPseudo

(
  • type
)
Object private static

returns a structured data object about a type's pseudo-events

Parameters:

  • type String

Returns:

Object: data

processType

(
  • type
)
Object private static

proccesses an event type, returning a valid data object from that name

Parameters:

  • type String

Returns:

Object: data

removeEvent

(
  • event
  • function
)
chainable

removes a function from an event

Parameters:

  • event String

    type

  • function Function

    to remove from stack