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