2 YUI Library - Event - Release Notes
6 * Custom Event fire() now throws caught exceptions if YAHOO.util.throwErrors =
7 true. In either case, a message is written to the logger console.
10 * Arrays are once again resized when a listener is removed.
11 * onAvailable/onContentReady stop polling when there is nothing to look for.
14 * Added try/catch to getTarget to suppress errors when targeting
16 * Increased the default poll interval to 20ms, and decreased poll
17 retries to 2000 to reduce IE CPU usage.
18 * onDOMReady now uses the native DOMContentLoaded event for the
19 latest releases of WebKit since it support for it was added.
20 * Restored the code that removes all listeners during the unload event to
21 address issues caused by the way FireFox persists listeners through
25 * Reverted clearAttributes() change to fix IE memory leak on iframes/windows
28 * getListeners/purgeElement accepts either an element reference or an element id
29 * onAvailable/onContentReady accepts a single id or an array of ids
30 * No longer removing listeners during the unload event for non-IE browsers
31 * IE unload strategy for cross page memory leaks changed from removing each listener
32 to calling clearAttributes()
33 * the DOMReady property is now public
34 * Changed IE onDOMReady approach from the defered script node hack to the doScroll('left') hack
35 * getCharChode now Remaps SHIFT-TAB key code (25) to TAB (9) in Safari
36 * getCharCode provides the proper key codes for page up and page down in Safari
37 * Restored object check to _isValidCollection.
38 * In KeyListener, added keycode constants for some of the special keys.
39 * Rolled back the change added for hacking around IE errors from bubbled
40 events that originally targeted an ActiveX control.
43 * CustomEvent fire() now catches exceptions thrown by the subscribers so
44 that the rest of the subscribers execute. The exception is logged and
45 stored in the "lastError" property.
46 * Performance tweak: _isValidCollection fails strings first.
47 * onAvailable/onContentReady will work if an element ref rather than an
49 * getListeners: fixed the values for the obj and adjust properties.
51 * Added IE hack for when the event target is something that can't be
52 inspected (like a VML canvas). In this case the target is set to
53 the element the listener is bound to.
56 * addListener now produces a logger warning if the supplied callback is
58 * Reduced the likelihood that window onload listeners fire before
59 onAvailable listeners when the two happen near the same moment.
60 * Fixed an IE error that could occur when the library was injected into
61 the page after window onload.
62 * The onDOMReady listener will be executed immediately if the
63 DOMReady event had already fired prior to the call.
64 * Unsubscribing custom events within a handler for the event now works
66 * EventProvider unsubscribeAll will unsubscribe all listeners from
67 all hosted custom events if the type is not specified.
68 * Event.getKeyCode now checks keyCode before charCode for Safari normalization.
69 Safari arrow key codes are normalized as well.
70 * Broke up the </script> in Event to allow it to be included inline
76 * onAvailable listeners are processed before onContentReady listeners so
77 they fire in the logical order when an element is found to be available
78 and ready in the same pass.
79 * Added onDOMReady for receiving notification when the DOM is first usable.
80 * In Internet Explorer, onAvailable/onContentReady checks now start when
81 DOMReady fires to reduce the possibility of receiving an "operation
82 aborted" errors when inserting DOM nodes during in the onAvailable/
83 onContentReady listener execution.
84 * CustomEvent subscribers supplying undefined callbacks will be notified
85 when subscribing rather than having an ambiguous error thrown when the
87 * Fixed missing html tags in the examples.
88 * POLL_INTERVAL is 10 ms.
89 * YAHOO.util.CustomEvent is now declared before YAHOO.util.Event.
93 * YAHOO.util.KeyListener was moved from the container package into event.
95 * The Safari bug that made it so preventDefault would not work with click
96 and double-click listeners on anchor tags was resolved in version 2.0.4.
97 The workaround (using DOM0 events for these instead of the normal DOM2
98 events) is now only used for releases prior to 2.0.4.
100 * getListeners/purgeElement now work correctly with unload listeners
102 * When legacyEvents are used (Safari<2.0.4 click events), if there was an
103 existing DOM0 event that the utility replaced, it is executed along with
104 the listeners that were added with the utility.
106 * Restored Event.regCE for compatibility with a beta release of the library
107 that in use in an external API.
109 * unsubscribe in CustomEvent and EventProvider will remove all listeners
110 if the listener is omitted.
112 * Added unsubscribeAll to EventProvider
114 * Added Event.lastError which stores the most recent error object if
115 a browser-specific add/remove listener call throws an exception.
119 * Fixed a bug introduced in 0.12.1 release caused nested onAvailable
124 * If an error is thrown during the browser-specific add/remove lister call,
125 addListener/removeListener will catch the error and return false.
127 * onAvailable array items are nulled out instead of deleted when completed to
128 get around an Opera issue introduced in a recent version of the browser.
132 * If the function argument is not provided to Event.removeListener, all
133 all listeners for the specified event type on the element will be removed.
135 * CustomEvent now has an optional parameter that defines the signature of
136 the listeners for this event. Two signatures are supported:
138 YAHOO.util.CustomEvent.LIST:
140 param2: array of arguments provided to fire()
141 param3: <optional> the custom object supplied to subscribe()
143 YAHOO.util.CustomEvent.FLAT:
144 param1: the first argument provided to fire()
145 param2: <optional> the custom object supplied to subscribe()
147 The new flat signature makes it possible to provide a better API
148 when using custom events, and it makes it possible to transparently
151 * The parameters for overriding scope in both Event.addListener, and
152 CustomEvent.subscribe have been augmented. In addition to the
153 previous behavior where a true value would make the previous parameter
154 the execution scope, an object can be supplied instead. If an object
155 is provided, that object becomes the scope obj. This makes it possible
156 to pass a both a custom object and adjust the scope to a different object.
158 * Added EventProvider, which is a wrapper for CustomEvent that makes it
159 possible to subscribe to events by name, whether or not the event has
160 been created. This class was designed to be used with YAHOO.augment.
161 EventProvider custom events are created with the new FLAT listener
164 * CustomEvent subscribers can return false to stop the propagation of
167 * CustomEvents now have an onSubscribe custom event that can used to the
168 case where a subscriber subscribes to an one-time event that has already
169 happened. Also provides a way for the implementer to defer initialization
170 logic until after the first subscription.
172 * Event.getCharCode now always returns keyCode if charCode is not available.
174 * Added Event.onContentReady, which is similar to onAvailable, but it also
175 checks simblings to try to determine when the element's children are
180 * Fixed a memory leak in IE6 that occurred when the utility was hosted in
183 * Fixed an issue with Safari click listeners when listeners were removed.
187 * The listener cache is now pruned when events are removed. This fixes
188 a performance issue when adding many listeners, removing them, and
189 adding them again repeatedly.
191 * Safari click listeners will work correctly if a bound element is removed
192 from the DOM and a new element with the same ID is added.
194 * Removed the code that automatically unsubscribed custom event listeners.
198 * Added Event.purgeElement which will remove all listeners added via
199 addListener from the supplied element. If an optional "type" parameter
200 is supplied, only events of that type will be removed. Optionally, the
201 purge can be performed recursively on the element's children as well.
203 * Added Event.getListeners which will return all listeners attached to
204 a given element.. either all listeners or listeners of a specific type.
206 * getTarget now automatically resolves text nodes. The optional parameter
207 for this feature is now deprecated.
209 * getRelatedTarget now resolves text nodes for the browsers that return the
210 text node rather than its host HTML element.
212 * CustomEvent now logs the custom event activity if the logger widget is available
216 * Added Safari dblclick to the list of legacy events.
218 * When multiple identical event handlers are defined, multiple calls
219 to removeListener can now remove all of them.
221 * removeListener works properly for unload events
223 * Legacy event bookkeeping is more efficient, improving the performance for
224 adding Safari click events.
226 * _unload() is more efficient, improving the page transition experience in
227 Safari in particular.
229 * addListener, removeListener now return false if the function argument is
232 * Fixed an operator precedence issue in getCharCode.
234 * Added Event.getXY, which returns [Event.getPageX(e), Event.getPageY(e)]
236 * Added Event.onAvailable, which will execute the callback when the element
237 with the supplied id is found. Currently searches periodically until the
238 window load event or for up to 10 seconds after the onAvailable method
241 * The lazy listener attachment process now will poll beyond the window load
242 event in order to better handle the case when a listener is defined
243 late in the page but before the element is in the dom.
245 * Fixed browser detection for Opera installations reporting as IE.
247 * It is now possible to remove and re-add legacy events (Safari click event).