EventEmitter

Namespace

JXG.EventEmitter namespace handles custom event emitters.

Members

Own

(static) eventHandlers : Object

Description

Holds the registered event handlers.

Type
Object
Source
utils/event.js, line 51

(static) suspended : Object

Description

Events can be suspended to prevent endless loops.

Type
Object
Source
utils/event.js, line 57

Inherited

none

Methods

Own

(static) 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:

Parameters

Name Type Description
o Object

Details

Source
utils/event.js, line 156

(static) off(event, handleropt)

Unregister an event handler.

Parameters

Name Type Attributes Description
event String
handler function <optional>

Returns

Reference to the object.

Details

Source
utils/event.js, line 122

(static) on(event, handler, contextopt)

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

As of version 1.5.0, it is only possible to access the element via "this" if the event listener is supplied as regular JavaScript function and not as arrow function.

Parameters

Name Type Attributes Description
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.

Details

Source
utils/event.js, line 101

(static) trigger(event, args)

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

Parameters

Name Type Description
event Array
args Array

The arguments passed onto the event handler

Returns

Reference to the object.

Details

Source
utils/event.js, line 65

Inherited

none

Details

EventEmitter

Source
utils/event.js, line 46