Class type Goog.​Events.​eventTarget

class type eventTarget = object..end

Inherits

  • Goog.​Disposable.​disposableAdds an event listener to the event target. The same handler can only be added once per the type. Even if you add the same handler multiple times using the same type then it will only be called once when the event is dispatched. Supported for legacy but use goog.events.listen(src, type, handler) instead.

method addEventListener : 
Js.js_string Js.t ->
(unit -> bool Js.t) Js.callback -> bool Js.t Js.opt -> unit Js.meth
method dispatchEvent : 
(Js.js_string Js.t, event Js.t) Goog.Tools.Union.t ->
bool Js.t Js.meth

Dispatches an event (or event like object) and calls all listeners listening for events of this type. The type of the event is decided by the type property on the event object.

If any of the listeners returns false OR calls preventDefault then this function will return false. If one of the capture listeners calls stopPropagation, then the bubble listeners won't fire.

method getParentEventTarget : eventTarget Js.t Js.meth

Returns the parent of this event target to use for bubbling.

method removeEventListener : 
Js.js_string Js.t ->
(unit -> bool Js.t) Js.callback -> bool Js.t Js.opt -> unit Js.meth

Removes an event listener from the event target. The handler must be the same object as the one added. If the handler has not been added then nothing is done.

method setParentEventTarget : eventTarget Js.t Js.opt -> unit Js.meth

Sets the parent of this event target to use for bubbling.