eventtarget.js
No description.

File Location

/goog/events/eventtarget.js

Classes

goog.events.EventTarget
An implementation of goog.events.Listenable with full W3C EventTarget-like support (capture/bubble mechanism, stopping event propagation, preventing default actions). You may subclass this class to turn your class into a Listenable. Unless propagation is stopped, an event dispatched by an EventTarget will bubble to the parent returned by getParentEventTarget. To set the parent, call setParentEventTarget. Subclasses that don't support changing the parent can override the setter to throw an error. Example usage:
  var source = new goog.events.EventTarget();
  function handleEvent(e) {
    alert('Type: ' + e.type + '; Target: ' + e.target);
  }
  source.listen('foo', handleEvent);
  // Or: goog.events.listen(source, 'foo', handleEvent);
  ...
  source.dispatchEvent('foo');  // will call handleEvent
  ...
  source.unlisten('foo', handleEvent);
  // Or: goog.events.unlisten(source, 'foo', handleEvent);

Public Protected Private

Global Functions

goog.events.EventTarget.dispatchEventInternal_(targeteopt_ancestorsTree) boolean
Dispatches the given event on the ancestorsTree.
Arguments:
target : !Object
The target to dispatch on.
e : goog.events.Event | Object | string
The event object.
opt_ancestorsTree : Array.<goog.events.Listenable>>
The ancestors tree of the target, in reverse order from the closest ancestor to the root event target. May be null if the target has no ancestor.
Returns: boolean  If anyone called preventDefault on the event object (or if any of the listeners returns false) this will also return false.
code »

Directory events

File Reference