2 YUI Library - Event - Release Notes
5 * addListener now produces a logger warning if the supplied callback is
7 * Reduced the likelihood that window onload listeners fire before
8 onAvailable listeners when the two happen near the same moment.
9 * Fixed an IE error that could occur when the library was injected into
10 the page after window onload.
11 * The onDOMReady listener will be executed immediately if the
12 DOMReady event had already fired prior to the call.
13 * Unsubscribing custom events within a handler for the event now works
15 * EventProvider unsubscribeAll will unsubscribe all listeners from
16 all hosted custom events if the type is not specified.
17 * Event.getKeyCode now checks keyCode before charCode for Safari normalization.
18 Safari arrow key codes are normalized as well.
19 * Broke up the </script> in Event to allow it to be included inline
25 * onAvailable listeners are processed before onContentReady listeners so
26 they fire in the logical order when an element is found to be available
27 and ready in the same pass.
28 * Added onDOMReady for receiving notification when the DOM is first usable.
29 * In Internet Explorer, onAvailable/onContentReady checks now start when
30 DOMReady fires to reduce the possibility of receiving an "operation
31 aborted" errors when inserting DOM nodes during in the onAvailable/
32 onContentReady listener execution.
33 * CustomEvent subscribers supplying undefined callbacks will be notified
34 when subscribing rather than having an ambiguous error thrown when the
36 * Fixed missing html tags in the examples.
37 * POLL_INTERVAL is 10 ms.
38 * YAHOO.util.CustomEvent is now declared before YAHOO.util.Event.
42 * YAHOO.util.KeyListener was moved from the container package into event.
44 * The Safari bug that made it so preventDefault would not work with click
45 and double-click listeners on anchor tags was resolved in version 2.0.4.
46 The workaround (using DOM0 events for these instead of the normal DOM2
47 events) is now only used for releases prior to 2.0.4.
49 * getListeners/purgeElement now work correctly with unload listeners
51 * When legacyEvents are used (Safari<2.0.4 click events), if there was an
52 existing DOM0 event that the utility replaced, it is executed along with
53 the listeners that were added with the utility.
55 * Restored Event.regCE for compatibility with a beta release of the library
56 that in use in an external API.
58 * unsubscribe in CustomEvent and EventProvider will remove all listeners
59 if the listener is omitted.
61 * Added unsubscribeAll to EventProvider
63 * Added Event.lastError which stores the most recent error object if
64 a browser-specific add/remove listener call throws an exception.
68 * Fixed a bug introduced in 0.12.1 release caused nested onAvailable
73 * If an error is thrown during the browser-specific add/remove lister call,
74 addListener/removeListener will catch the error and return false.
76 * onAvailable array items are nulled out instead of deleted when completed to
77 get around an Opera issue introduced in a recent version of the browser.
81 * If the function argument is not provided to Event.removeListener, all
82 all listeners for the specified event type on the element will be removed.
84 * CustomEvent now has an optional parameter that defines the signature of
85 the listeners for this event. Two signatures are supported:
87 YAHOO.util.CustomEvent.LIST:
89 param2: array of arguments provided to fire()
90 param3: <optional> the custom object supplied to subscribe()
92 YAHOO.util.CustomEvent.FLAT:
93 param1: the first argument provided to fire()
94 param2: <optional> the custom object supplied to subscribe()
96 The new flat signature makes it possible to provide a better API
97 when using custom events, and it makes it possible to transparently
100 * The parameters for overriding scope in both Event.addListener, and
101 CustomEvent.subscribe have been augmented. In addition to the
102 previous behavior where a true value would make the previous parameter
103 the execution scope, an object can be supplied instead. If an object
104 is provided, that object becomes the scope obj. This makes it possible
105 to pass a both a custom object and adjust the scope to a different object.
107 * Added EventProvider, which is a wrapper for CustomEvent that makes it
108 possible to subscribe to events by name, whether or not the event has
109 been created. This class was designed to be used with YAHOO.augment.
110 EventProvider custom events are created with the new FLAT listener
113 * CustomEvent subscribers can return false to stop the propagation of
116 * CustomEvents now have an onSubscribe custom event that can used to the
117 case where a subscriber subscribes to an one-time event that has already
118 happened. Also provides a way for the implementer to defer initialization
119 logic until after the first subscription.
121 * Event.getCharCode now always returns keyCode if charCode is not available.
123 * Added Event.onContentReady, which is similar to onAvailable, but it also
124 checks simblings to try to determine when the element's children are
129 * Fixed a memory leak in IE6 that occurred when the utility was hosted in
132 * Fixed an issue with Safari click listeners when listeners were removed.
136 * The listener cache is now pruned when events are removed. This fixes
137 a performance issue when adding many listeners, removing them, and
138 adding them again repeatedly.
140 * Safari click listeners will work correctly if a bound element is removed
141 from the DOM and a new element with the same ID is added.
143 * Removed the code that automatically unsubscribed custom event listeners.
147 * Added Event.purgeElement which will remove all listeners added via
148 addListener from the supplied element. If an optional "type" parameter
149 is supplied, only events of that type will be removed. Optionally, the
150 purge can be performed recursively on the element's children as well.
152 * Added Event.getListeners which will return all listeners attached to
153 a given element.. either all listeners or listeners of a specific type.
155 * getTarget now automatically resolves text nodes. The optional parameter
156 for this feature is now deprecated.
158 * getRelatedTarget now resolves text nodes for the browsers that return the
159 text node rather than its host HTML element.
161 * CustomEvent now logs the custom event activity if the logger widget is available
165 * Added Safari dblclick to the list of legacy events.
167 * When multiple identical event handlers are defined, multiple calls
168 to removeListener can now remove all of them.
170 * removeListener works properly for unload events
172 * Legacy event bookkeeping is more efficient, improving the performance for
173 adding Safari click events.
175 * _unload() is more efficient, improving the page transition experience in
176 Safari in particular.
178 * addListener, removeListener now return false if the function argument is
181 * Fixed an operator precedence issue in getCharCode.
183 * Added Event.getXY, which returns [Event.getPageX(e), Event.getPageY(e)]
185 * Added Event.onAvailable, which will execute the callback when the element
186 with the supplied id is found. Currently searches periodically until the
187 window load event or for up to 10 seconds after the onAvailable method
190 * The lazy listener attachment process now will poll beyond the window load
191 event in order to better handle the case when a listener is defined
192 late in the page but before the element is in the dom.
194 * Fixed browser detection for Opera installations reporting as IE.
196 * It is now possible to remove and re-add legacy events (Safari click event).