WidgetUIEvents.js revision 8a864950bf1abc56d7b4c1ef7f086f1a60223b2f
98N/A * Support for Widget UI Events (Custom Events fired by the widget, which wrap the underlying DOM events - e.g. widget:click, widget:mousedown) 98N/A * @submodule widget-uievents 98N/A * Destructor logic for UI event infrastructure, 98N/A * invoked during Widget destruction. 98N/A * @method _destroyUIEvents 606N/A // Unregister this Widget instance as needing this delegated 98N/A // There are no more Widget instances using this delegated 98N/A // event listener, so detach it. 606N/A * Map of DOM events that should be fired as Custom Events by the 98N/A * @property UI_EVENTS 98N/A * Returns the node on which to bind delegate listeners. 98N/A * @method _getUIEventNode 98N/A * Binds a delegated DOM event listener of the specified type to the 98N/A * Widget's outtermost DOM element to facilitate the firing of a Custom * Event of the same type for the Widget instance. * @param type {String} String representing the name of the event // For each Node instance: Ensure that there is only one delegated // event listener used to fire Widget UI events. Y.
log(
"Creating delegate for the " +
type +
" event.",
"info",
"widget");
// Make the DOM event a property of the custom event // so that developers still have access to it. // Register this Widget as using this Node as a delegation container. * Determines if the specified event is a UI event. * @param type {String} String representing the name of the event * @return {String} Event Returns the name of the UI Event, otherwise * Sets up infastructure required to fire a UI event. * @param type {String} String representing the name of the event Y.
log(
"Deferring creation of " +
type +
" delegate until render.",
"info",
"widget");
// Override of "on" from Base to facilitate the firing of Widget events // based on DOM events of the same name/type (e.g. "click", "mouseover"). // Temporary solution until we have the ability to listen to when // someone adds an event listener (bug 2528230) // Override of "publish" from Base to facilitate the firing of Widget events // based on DOM events of the same name/type (e.g. "click", "mouseover"). // Temporary solution until we have the ability to listen to when // someone publishes an event (bug 2528230) },
true);
// overwrite existing EventTarget methods