delete elemData.handle;
if ( typeof elemData === "function" ) {
- delete elem.events;
+ jQuery.removeData( elem, "events" );
} else if ( jQuery.isEmptyObject( elemData ) ) {
jQuery.removeData( elem );
// Trigger the event, it is assumed that "handle" is a function
var handle = elem.nodeType ?
jQuery.data( elem, "handle" ) :
- elem.events && elem.events.handle;
+ (jQuery.data( elem, "events" ) || {}).handle;
if ( handle ) {
handle.apply( elem, data );
// Beforeactivate happens also before the previous element is blurred
// with this event you can't trigger a change event, but you can store
- // information/focus[in] is not needed anymore
+ // information
beforeactivate: function( e ) {
var elem = e.target;
jQuery.data( elem, "_change_data", getVal(elem) );
};
changeFilters = jQuery.event.special.change.filters;
+
+ // Handle when the input is .focus()'d
+ changeFilters.focus = changeFilters.beforeactivate;
}
function trigger( type, elem, args ) {
// More info:
// - http://isaacschlueter.com/2006/10/msie-memory-leaks/
if ( window.attachEvent && !window.addEventListener ) {
- window.attachEvent("onunload", function() {
+ jQuery(window).bind("unload", function() {
for ( var id in jQuery.cache ) {
if ( jQuery.cache[ id ].handle ) {
// Try/Catch is to handle iframes being unloaded, see #4280