PythonMonkey   v0.3.1 (dev)
Loading...
Searching...
No Matches
EventTarget Class Reference
Inheritance diagram for EventTarget:
[legend]

Public Member Functions

 addEventListener (type, listener)
 
 removeEventListener (type, listener)
 
 dispatchEvent (event)
 
 _hasAnyListeners ()
 
 _hasListeners (type)
 

Member Function Documentation

◆ _hasAnyListeners()

EventTarget::_hasAnyListeners ( )

Determine whether the target has any kind of event listeners

◆ _hasListeners()

EventTarget::_hasListeners (   type)

Determine whether the target has listeners of the given event type

Parameters
{string}[type]

◆ addEventListener()

EventTarget::addEventListener (   type,
  listener 
)

@readonly @type {{ [type: string]: Set<EventListener> }} Add an event listener that will be called whenever the specified event is delivered to the target

Parameters
{string}type A case-sensitive string representing the event type to listen for
{EventListener| null} listener The object that receives a notification when an event of the specified type occurs

◆ dispatchEvent()

EventTarget::dispatchEvent (   event)

Send an Event to the target, (synchronously) invoking the affected event listeners in the appropriate order.

Parameters
{Event}event The Event object to dispatch

◆ removeEventListener()

EventTarget::removeEventListener (   type,
  listener 
)

Remove an event listener previously registered with EventTarget.addEventListener() from the target.

Parameters
{string}type A string which specifies the type of event for which to remove an event listener.
{EventListener}listener The event listener function of the event handler to remove from the event target.

The documentation for this class was generated from the following file: