]> source.dussan.org Git - jquery.git/commitdiff
Introduce a temporary hack to allow jQuery.fn.data("events") to continue to work... 170/head
authorColin Snover <github.com@zetafleet.com>
Mon, 17 Jan 2011 21:22:49 +0000 (15:22 -0600)
committerColin Snover <github.com@zetafleet.com>
Mon, 17 Jan 2011 21:22:49 +0000 (15:22 -0600)
src/data.js

index a1abc9ed6a05cd597da730711c37493045e1d86e..21f0e3a55f6592a1607878ecf78de444c17dfe9f 100644 (file)
@@ -93,6 +93,13 @@ jQuery.extend({
                        thisCache[ name ] = data;
                }
 
+               // TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should
+               // not attempt to inspect the internal events object using jQuery.data, as this
+               // internal data object is undocumented and subject to change.
+               if ( name === "events" && !thisCache[name] ) {
+                       return thisCache[ internalKey ] && thisCache[ internalKey ].events;
+               }
+
                return getByName ? thisCache[ name ] : thisCache;
        },