Class: Events

og.Events

new og.Events(eventNames)

Base events class to handle custom events.
Name Type Description
eventNames Array.<string> optional Event names that could be dispatched.

Members

protected_counternumber

Event identifier.

protected_eventNamesArray.<string>

Registered event names.

protected_stopPropagationboolean

Stop propagation flag

Methods

protected_stamp(obj){boolean}

Returns true if event callback has stamped.
Name Type Description
obj Object Function.
Returns:
Type Description
boolean
Removes all events.

dispatch(event, obj)

Dispatch event.
Name Type Description
event Object Event instance property that created by event name.
obj Object optional Event object.

off(name, callback)

Stop listening event name with specified callback function.
Name Type Description
name string Event name.
callback eventCallback Attached event callback.

on(name, callback, sender)

Attach listener.
Name Type Description
name string Event name to listen.
callback eventCallback Event callback function.
sender Object Event callback function owner.

registerNames(eventNames)

Function that creates event object properties that would be dispatched.
Name Type Description
eventNames Array.<string> Specified event names list.

stopPropagation()

Brakes events propagation.