Skip to content
Permalink
Browse files

Fix #12436, make delegated events fast again. Close gh-923.

Retains the rooted-at-delegateTarget behavior fixed in #12383 by afd717d.
  • Loading branch information...
dmethvin committed Sep 10, 2012
1 parent c79a533 commit 9b67b4c0ef311f96d6e035fd38bbfbe42a82b392
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/event.js
@@ -81,6 +81,7 @@ jQuery.event = {
handler: handler,
guid: handler.guid,
selector: selector,
needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
namespace: namespaces.join(".")
}, handleObjIn );

@@ -393,7 +394,9 @@ jQuery.event = {
sel = handleObj.selector;

if ( selMatch[ sel ] === undefined ) {
selMatch[ sel ] = jQuery( sel, this ).index( cur ) >= 0;
selMatch[ sel ] = handleObj.needsContext ?
jQuery( sel, this ).index( cur ) >= 0 :
jQuery.find( sel, this, null, [ cur ] ).length;
}
if ( selMatch[ sel ] ) {
matches.push( handleObj );

0 comments on commit 9b67b4c

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