events.js
No description.

File Location

/goog/events/events.js


Public Protected Private

Enumerations

Global Functions

goog.events.dispatchEvent(srce) boolean
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.
Arguments:
src : goog.events.Listenable
The event target.
e : goog.events.EventLike
Event object.
Returns: boolean  If anyone called preventDefault on the event object (or if any of the handlers returns false) this will also return false. If there are no handlers, or if all handlers return true, this returns true.
code »
goog.events.expose(e) string
Provides a nice string showing the normalized event objects public members
Arguments:
e : Object
Event Object.
Returns: string  String of the public members of the normalized event object.
code »
goog.events.getProxy&f()
No description.
code »
goog.events.fireListener(listenereventObject) boolean
Fires a listener with a set of arguments
Arguments:
listener : goog.events.Listener
The listener object to call.
eventObject : Object
The event object to pass to the listener.
Returns: boolean  Result of listener.
code »
goog.events.fireListeners(objtypecaptureeventObject) boolean
Fires an object's listeners of a particular type and phase
Arguments:
obj : Object
Object whose listeners to call.
type : string | !goog.events.EventId
Event type.
capture : boolean
Which event phase.
eventObject : Object
Event object to be passed to listener.
Returns: boolean  True if all listeners returned true else false.
code »
goog.events.fireListeners_(objtypecaptureeventObject) boolean
Fires an object's listeners of a particular type and phase.
Arguments:
obj : Object
Object whose listeners to call.
type : string | !goog.events.EventId
Event type.
capture : boolean
Which event phase.
eventObject : Object
Event object to be passed to listener.
Returns: boolean  True if all listeners returned true else false.
code »
goog.events.getListener(srctypeopt_captopt_handler) goog.events.ListenableKey
Gets the goog.events.Listener for the event or null if no such listener is in use.
Arguments:
src : EventTarget | goog.events.Listenable
The target from which to get listeners.
type : ?string | !goog.events.EventId.<EVENTOBJ>
The type of the event.
: function(EVENTOBJ):? | ?{handleEvent:function():?
No description.
opt_capt : boolean=
In DOM-compliant browsers, this determines whether the listener is fired during the capture or bubble phase of the event.
opt_handler : Object=
Element in whose scope to call the listener.
Returns: goog.events.ListenableKey  the found listener or null if not found.
code »
goog.events.getListenerMap_(src) goog.events.ListenerMap
No description.
Arguments:
src : EventTarget
The source object.
Returns: goog.events.ListenerMap  A listener map for the given source object, or null if none exists.
code »
goog.events.getListeners(objtypecapture) Array.<goog.events.Listener>
Gets the listeners for a given object, type and capture phase.
Arguments:
obj : Object
Object to get listeners for.
type : string | !goog.events.EventId
Event type.
capture : boolean
Capture phase?.
Returns: Array.<goog.events.Listener>  Array of listener objects.
code »
goog.events.getOnString_(type) string
Returns a string with on prepended to the specified type. This is used for IE which expects "on" to be prepended. This function caches the string in order to avoid extra allocations in steady state.
Arguments:
type : string
Event type.
Returns: string  The type string with 'on' prepended.
code »
goog.events.getProxy() !Function
Helper function for returning a proxy function.
Returns: !Function  A new or reused function object.
code »
goog.events.getTotalListenerCount() number
This returns estimated count, now that Closure no longer stores a central listener registry. We still return an estimation to keep existing listener-related tests passing. In the near future, this function will be removed. Gets the total number of listeners currently in the system.
Returns: number  Number of listeners.
code »
goog.events.getUniqueId(identifier) string
Creates a unique event id.
Arguments:
identifier : string
The identifier.
Returns: string  A unique identifier.
code »
goog.events.handleBrowserEvent_(listeneropt_evt) boolean
Handles an event and dispatches it to the correct listeners. This function is a proxy for the real listener the user specified.
Arguments:
listener : goog.events.Listener
The listener object.
opt_evt : Event=
Optional event object that gets passed in via the native event handlers.
Returns: boolean  Result of the event handler.
code »
goog.events.hasListener(objopt_typeopt_capture) boolean
Returns whether an event target has any active listeners matching the specified signature. If either the type or capture parameters are unspecified, the function will match on the remaining criteria.
Arguments:
obj : EventTarget | goog.events.Listenable
Target to get listeners for.
opt_type : string | !goog.events.EventId=
Event type.
opt_capture : boolean=
Whether to check for capture or bubble-phase listeners.
Returns: boolean  Whether an event target has one or more listeners matching the requested type and/or capture phase.
code »
goog.events.isMarkedIeEvent_(e) boolean
This is used to check if an IE event has already been handled by the Closure system so we do not do the Closure pass twice for a bubbling event.
Arguments:
e : Event
The IE browser event.
Returns: boolean  True if the event object has been marked.
code »
goog.events.listen(srctypeopt_captopt_handler) goog.events.Key
Adds an event listener for a specific event on a native event target (such as a DOM element) or an object that has implemented goog.events.Listenable. A listener can only be added once to an object and if it is added again the key for the listener is returned. Note that if the existing listener is a one-off listener (registered via listenOnce), it will no longer be a one-off listener after a call to listen().
Arguments:
src : EventTarget | goog.events.Listenable
The node to listen to events on.
type : string | Array.<string> |  !goog.events.EventId.<EVENTOBJ> | !Array.<!goog.events.EventId.<EVENTOBJ>>
Event type or array of event types.
: function(this:T, EVENTOBJ):? | ?{handleEvent:function():?
No description.
opt_capt : boolean=
Whether to fire in capture phase (defaults to false).
opt_handler : T=
Element in whose scope to call the listener.
Returns: goog.events.Key  Unique key for the listener.
code »
goog.events.listenOnce(srctypeopt_captopt_handler) goog.events.Key
Adds an event listener for a specific event on a native event target (such as a DOM element) or an object that has implemented goog.events.Listenable. After the event has fired the event listener is removed from the target. If an existing listener already exists, listenOnce will do nothing. In particular, if the listener was previously registered via listen(), listenOnce() will not turn the listener into a one-off listener. Similarly, if there is already an existing one-off listener, listenOnce does not modify the listeners (it is still a once listener).
Arguments:
src : EventTarget | goog.events.Listenable
The node to listen to events on.
type : string | Array.<string> |  !goog.events.EventId.<EVENTOBJ> | !Array.<!goog.events.EventId.<EVENTOBJ>>
Event type or array of event types.
: function(this:T, EVENTOBJ):? | ?{handleEvent:function():?
No description.
opt_capt : boolean=
Fire in capture phase?.
opt_handler : T=
Element in whose scope to call the listener.
Returns: goog.events.Key  Unique key for the listener.
code »
goog.events.listenWithWrapper(srcwrapperopt_captopt_handler)
Adds an event listener with a specific event wrapper on a DOM Node or an object that has implemented goog.events.Listenable. A listener can only be added once to an object.
Arguments:
src : EventTarget | goog.events.Listenable
The target to listen to events on.
wrapper : goog.events.EventWrapper
Event wrapper to use.
: ?function(this:T, ):? | ?{handleEvent:function():?
No description.
opt_capt : boolean=
Whether to fire in capture phase (defaults to false).
opt_handler : T=
Element in whose scope to call the listener.
code »
goog.events.listen_(srctypelistenercallOnceopt_captopt_handler) goog.events.ListenableKey
Adds an event listener for a specific event on a native event target. A listener can only be added once to an object and if it is added again the key for the listener is returned. Note that a one-off listener will not change an existing listener, if any. On the other hand a normal listener will change existing one-off listener to become a normal listener.
Arguments:
src : EventTarget
The node to listen to events on.
type : string | !goog.events.EventId
Event type.
listener : !Function
Callback function.
callOnce : boolean
Whether the listener is a one-off listener or otherwise.
opt_capt : boolean=
Whether to fire in capture phase (defaults to false).
opt_handler : Object=
Element in whose scope to call the listener.
Returns: goog.events.ListenableKey  Unique key for the listener.
code »
goog.events.markIeEvent_(e)
This is used to mark the IE event object so we do not do the Closure pass twice for a bubbling event.
Arguments:
e : Event
The IE browser event.
code »
goog.events.protectBrowserEventEntryPoint(errorHandler)
Installs exception protection for the browser event entry point using the given error handler.
Arguments:
errorHandler : goog.debug.ErrorHandler
Error handler with which to protect the entry point.
code »
goog.events.getProxy&proxyCallbackFunction()
No description.
code »
goog.events.removeAll(opt_objopt_type) number
Removes all listeners from an object. You can also optionally remove listeners of a particular type.
Arguments:
opt_obj : Object=
Object to remove listeners from. Not specifying opt_obj is now DEPRECATED (it used to remove all registered listeners).
opt_type : string | !goog.events.EventId=
Type of event to remove. Default is all types.
Returns: number  Number of listeners removed.
code »
goog.events.removeAllNativeListeners() number
This doesn't do anything, now that Closure no longer stores a central listener registry. Removes all native listeners registered via goog.events. Native listeners are listeners on native browser objects (such as DOM elements). In particular, goog.events.Listenable and goog.events.EventTarget listeners will NOT be removed.
Returns: number  Number of listeners removed.
code »
goog.events.unlisten(srctypeopt_captopt_handler) ?boolean
Removes an event listener which was added with listen().
Arguments:
src : EventTarget | goog.events.Listenable
The target to stop listening to events on.
type : string | Array.<string> |  !goog.events.EventId.<EVENTOBJ> | !Array.<!goog.events.EventId.<EVENTOBJ>>
Event type or array of event types to unlisten to.
: ?function():? | ?{handleEvent:function():?
No description.
opt_capt : boolean=
In DOM-compliant browsers, this determines whether the listener is fired during the capture or bubble phase of the event.
opt_handler : Object=
Element in whose scope to call the listener.
Returns: ?boolean  indicating whether the listener was there to remove.
code »
goog.events.unlistenByKey(key) boolean
Removes an event listener which was added with listen() by the key returned by listen().
Arguments:
key : goog.events.Key
The key returned by listen() for this event listener.
Returns: boolean  indicating whether the listener was there to remove.
code »
goog.events.unlistenWithWrapper(srcwrapperopt_captopt_handler)
Removes an event listener which was added with listenWithWrapper().
Arguments:
src : EventTarget | goog.events.Listenable
The target to stop listening to events on.
wrapper : goog.events.EventWrapper
Event wrapper to use.
: ?function():? | ?{handleEvent:function():?
No description.
opt_capt : boolean=
In DOM-compliant browsers, this determines whether the listener is fired during the capture or bubble phase of the event.
opt_handler : Object=
Element in whose scope to call the listener.
code »
goog.events.wrapListener(listener) !Function
No description.
Arguments:
listener : Object | Function
The listener function or an object that contains handleEvent method.
Returns: !Function  Either the original function or a function that calls obj.handleEvent. If the same listener is passed to this function more than once, the same function is guaranteed to be returned.
code »

Global Variables

function%12 :
No description.
Code »

Directory events

File Reference