Commit 7812aab1 authored by Richard Gibson's avatar Richard Gibson Committed by Dave Methvin

reduce size

parent 14c50da7
...@@ -359,7 +359,7 @@ jQuery.event = { ...@@ -359,7 +359,7 @@ jQuery.event = {
return; return;
} }
// Determine handlers that should run if there are delegated events // Determine handlers
handlerQueue = jQuery.event.handlers.call( this, event, handlers ); handlerQueue = jQuery.event.handlers.call( this, event, handlers );
// Run delegates first; they may want to stop propagation beneath us // Run delegates first; they may want to stop propagation beneath us
...@@ -399,30 +399,30 @@ jQuery.event = { ...@@ -399,30 +399,30 @@ jQuery.event = {
}, },
handlers: function( event, handlers ) { handlers: function( event, handlers ) {
var i, cur, selMatch, matches, handleObj, sel, var i, matches, sel, handleObj,
handlerQueue = [], handlerQueue = [],
delegateCount = handlers.delegateCount; delegateCount = handlers.delegateCount,
cur = event.target;
// Find delegate handlers
// Avoid non-left-click bubbling in Firefox (#3861) // Avoid non-left-click bubbling in Firefox (#3861)
if ( delegateCount && !(event.button && event.type === "click") ) { if ( delegateCount && (!event.button || event.type !== "click") ) {
for ( cur = event.target; cur != this; cur = cur.parentNode || this ) { for ( ; cur != this; cur = cur.parentNode || this ) {
// Don't process clicks (ONLY) on disabled elements (#6911, #8165, #11382, #11764) // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
if ( cur.disabled !== true || event.type !== "click" ) { if ( cur.disabled !== true || event.type !== "click" ) {
selMatch = {};
matches = []; matches = [];
i = 0; for ( i = 0; i < delegateCount; i++ ) {
for ( ; i < delegateCount; i++ ) {
handleObj = handlers[ i ]; handleObj = handlers[ i ];
sel = handleObj.selector; sel = handleObj.selector;
if ( selMatch[ sel ] === undefined ) { if ( matches[ sel ] === undefined ) {
selMatch[ sel ] = handleObj.needsContext ? matches[ sel ] = handleObj.needsContext ?
jQuery( sel, this ).index( cur ) >= 0 : jQuery( sel, this ).index( cur ) >= 0 :
jQuery.find( sel, this, null, [ cur ] ).length; jQuery.find( sel, this, null, [ cur ] ).length;
} }
if ( selMatch[ sel ] ) { if ( matches[ sel ] ) {
matches.push( handleObj ); matches.push( handleObj );
} }
} }
...@@ -434,7 +434,7 @@ jQuery.event = { ...@@ -434,7 +434,7 @@ jQuery.event = {
} }
// Add the remaining (directly-bound) handlers // Add the remaining (directly-bound) handlers
if ( handlers.length > delegateCount ) { if ( delegateCount < handlers.length ) {
handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
} }
......
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