API Docs for: 0.99.4
Show:

EventEmitter Class

Defined in: src/utils/event.js:49
Module: JXG

Methods

eventify

(
  • o
)

Implements the functionality from this interface in the given object. All objects getting their event handling capabilities from this method should document it by adding the on, off, triggerEventHandlers via the borrows tag as methods to their documentation:

@borrows JXG.EventEmitter#on as this.on

Parameters:

off

(
  • event
  • [handler]
)

Unregister an event handler.

Parameters:

Returns:

Reference to the object.

on

(
  • event
  • handler
  • [context]
)

Register a new event handler. For a list of possible events see documentation of the elements and objects implementing the EventEmitter interface.

Parameters:

  • event String
  • handler Function
  • [context] Object optional

    The context the handler will be called in, default is the element itself.

Returns:

Reference to the object.

trigger

(
  • event
  • args
)

Triggers all event handlers of this element for a given event.

Parameters:

  • event Array
  • args Array

    The arguments passed onto the event handler

Returns:

Reference to the object.

Properties

JXG.EventEmitter#eventHandlers

Object

Holds the registered event handlers.

JXG.EventEmitter#suspended

Object

Events can be suspended to prevent endless loops.