Commit b763cc66 authored by Brandon Aaron's avatar Brandon Aaron

fix regression in removing live events caused by r6324

parent d0750727
...@@ -402,11 +402,23 @@ jQuery.event = { ...@@ -402,11 +402,23 @@ jQuery.event = {
jQuery.event.add( this, data.live, liveHandler ); jQuery.event.add( this, data.live, liveHandler );
}, },
teardown: function( namespaces ) { remove: function( namespaces ) {
if ( namespaces.length ) {
var remove = 0, name = new RegExp("(^|\\.)" + namespaces[0] + "(\\.|$)");
jQuery.each( (jQuery.data(this, "events").live || {}), function() {
if ( name.test(this.type) ) {
remove++;
}
});
if ( remove < 1 ) {
jQuery.event.remove( this, namespaces[0], liveHandler ); jQuery.event.remove( this, namespaces[0], liveHandler );
} }
} }
} }
}
}
}; };
jQuery.Event = function( src ){ jQuery.Event = function( src ){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment