event-custom-complex-debug.js revision 2565b98e44163e7c68700e966cea1226a9e4c0d9
* Adds event facades, preventable default behavior, and bubbling. * @submodule event-custom-complex * Wraps and protects a custom event for use when emitFacade is set to true. * Requires the event-custom-complex module * @param e {Event} the custom event * @param currentTarget {HTMLElement} the element the listener was attached to * The arguments passed to fire * The event type, this can be overridden by the fire() payload ////////////////////////////////////////////////////// * Node reference for the targeted eventtarget * Node reference for the element that the listener was attached to. * Node reference to the relatedTarget * Stops the propagation to the next bubble target * @method stopPropagation * Stops the propagation to the next bubble target and * prevents any additional listeners from being exectued * @method stopImmediatePropagation * Prevents the event's default behavior * Stops the event propagation and prevents the default * @param immediate {boolean} if true additional listeners * on the current target will not be executed // queue this event if the current item in the queue bubbles // id of the first event in the stack // defaultFnQueue: new Y.Queue(), // self.log("Firing " + self + ", " + "args: " + args); self.
_facade =
null;
// kill facade to eliminate stale properties // self._procSubs(Y.merge(self.subscribers), args, ef); // bubble if this is hosted in an event target and propagation has not been stopped // if (host !== ef.target || es.type != self.type) { // self.bubbling = false; // broadcast listeners are fired as discreet events on the // YUI instance and potentially the YUI global. // set up stack to allow the next item to be processed // if the first argument is an object literal, apply the // properties to the event facade // protect the event facade properties // Allow the event type to be faked // update the details field with the arguments // use the original target when the event bubbled to this target * Stop propagation to bubble targets * @method stopPropagation * Stops propagation to bubble targets, and prevents any remaining * subscribers on the current target from executing. * @method stopImmediatePropagation * Prevents the execution of this event's defaultFn * Stops the event propagation and prevents the default * @param immediate {boolean} if true additional listeners * on the current target will not be executed * Registers another EventTarget as a bubble target. Bubble order * is determined by the order registered. Multiple targets can * Events can only bubble if emitFacade is true. * Included in the event-custom-complex submodule. * @param o {EventTarget} the target to add * Returns an array of bubble targets for this object. * Removes a bubble target * @param o {EventTarget} the target to remove * Propagate an event. Requires the event-custom-complex module. * @param evt {CustomEvent} the custom event to propagate * @return {boolean} the aggregated return value from Event.Custom.fire // Y.log('Bubbling ' + evt.type); // if this event was not published on the bubble target, // continue propagating the event. // set the original target to that the target payload on the // default publish may not have emitFacade true -- that // shouldn't be what the implementer meant to do // stopPropagation() was called },
'@VERSION@' ,{
requires:[
'event-custom-base']});