Skip to content
Permalink
Browse files

fix regression in removing live events caused by r6324

  • Loading branch information
brandonaaron committed May 12, 2009
1 parent d075072 commit b763cc6602fdf2bede16be5bf106ceaa1d1d0525
Showing with 14 additions and 2 deletions.
  1. +14 −2 src/event.js
@@ -402,8 +402,20 @@ jQuery.event = {
jQuery.event.add( this, data.live, liveHandler );
},

teardown: function( namespaces ) {
jQuery.event.remove( this, namespaces[0], liveHandler );
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 );
}
}
}
}
}

0 comments on commit b763cc6

Please sign in to comment.
You can’t perform that action at this time.