aboutsummaryrefslogtreecommitdiffstats
path: root/src/event.js
diff options
context:
space:
mode:
authorDave Methvin <dave.methvin@gmail.com>2012-08-28 10:07:16 -0400
committerDave Methvin <dave.methvin@gmail.com>2012-08-28 10:07:16 -0400
commitafd717df9e189d3e374ce938f03e2712f31c29e3 (patch)
tree9f36ebee37cc7e1354e3af7da83529281f635d37 /src/event.js
parentc078b83b3fea891e0c228a9f2d101481678b4c9d (diff)
downloadjquery-afd717df9e189d3e374ce938f03e2712f31c29e3.tar.gz
jquery-afd717df9e189d3e374ce938f03e2712f31c29e3.zip
Fix #12383. All selectors should be delegateTarget-relative
Diffstat (limited to 'src/event.js')
-rw-r--r--src/event.js9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/event.js b/src/event.js
index c22f5f872..0c7d827dc 100644
--- a/src/event.js
+++ b/src/event.js
@@ -361,7 +361,7 @@ jQuery.event = {
// Make a writable jQuery.Event from the native event object
event = jQuery.event.fix( event || window.event );
- var i, j, cur, jqcur, ret, selMatch, matched, matches, handleObj, sel, related,
+ var i, j, cur, ret, selMatch, matched, matches, handleObj, sel, related,
handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []),
delegateCount = handlers.delegateCount,
args = [].slice.call( arguments ),
@@ -382,23 +382,18 @@ jQuery.event = {
// Avoid non-left-click bubbling in Firefox (#3861)
if ( delegateCount && !(event.button && event.type === "click") ) {
- // Pregenerate a single jQuery object for reuse with .is()
- jqcur = jQuery(this);
- jqcur.context = this;
-
for ( cur = event.target; cur != this; cur = cur.parentNode || this ) {
// Don't process clicks (ONLY) on disabled elements (#6911, #8165, #xxxx)
if ( cur.disabled !== true || event.type !== "click" ) {
selMatch = {};
matches = [];
- jqcur[0] = cur;
for ( i = 0; i < delegateCount; i++ ) {
handleObj = handlers[ i ];
sel = handleObj.selector;
if ( selMatch[ sel ] === undefined ) {
- selMatch[ sel ] = jqcur.is( sel );
+ selMatch[ sel ] = jQuery( sel, this ).index( cur ) >= 0;
}
if ( selMatch[ sel ] ) {
matches.push( handleObj );