mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
fix regression in removing live events caused by r6324
This commit is contained in:
parent
d075072768
commit
b763cc6602
14
src/event.js
14
src/event.js
@ -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 ){
|
||||||
|
Loading…
Reference in New Issue
Block a user