Class: EventSource

OpenSeadragon.EventSource

For use by classes which want to support custom, non-browser events.

Constructor

new EventSource()

Source:

Methods

addHandler(eventName, handler, userDataopt)

Add an event handler for a given event.
Parameters:
Name Type Attributes Default Description
eventName String Name of event to register.
handler OpenSeadragon.EventHandler Function to call when event is triggered.
userData Object <optional>
null Arbitrary object to be passed unchanged to the handler.
Source:

addOnceHandler(eventName, handler, userDataopt, timesopt)

Add an event handler to be triggered only once (or a given number of times) for a given event.
Parameters:
Name Type Attributes Default Description
eventName String Name of event to register.
handler OpenSeadragon.EventHandler Function to call when event is triggered.
userData Object <optional>
null Arbitrary object to be passed unchanged to the handler.
times Number <optional>
1 The number of times to handle the event before removing it.
Source:

getHandler(eventName)

Get a function which iterates the list of all handlers registered for a given event, calling the handler for each.
Parameters:
Name Type Description
eventName String Name of event to get handlers for.
Source:

raiseEvent(eventName, eventArgs)

Trigger an event, optionally passing additional information.
Parameters:
Name Type Description
eventName String Name of event to register.
eventArgs Object Event-specific data.
Source:

removeAllHandlers(eventName)

Remove all event handlers for a given event type. If no type is given all event handlers for every event type are removed.
Parameters:
Name Type Description
eventName String Name of event for which all handlers are to be removed.
Source:

removeHandler(eventName, handler)

Remove a specific event handler for a given event.
Parameters:
Name Type Description
eventName String Name of event for which the handler is to be removed.
handler OpenSeadragon.EventHandler Function to be removed.
Source: