From: Rick Waldron Date: Thu, 27 Oct 2011 19:31:35 +0000 (-0400) Subject: Cleanup spacing in events.js. Fixes #10601 X-Git-Tag: 1.7rc2~5^2~6 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f0cf49fee2201718a56fe09d7a8be641f7775dc3;p=jquery.git Cleanup spacing in events.js. Fixes #10601 --- diff --git a/src/event.js b/src/event.js index 2171f4be4..3576bffca 100644 --- a/src/event.js +++ b/src/event.js @@ -81,7 +81,7 @@ jQuery.event = { tns = rtypenamespace.exec( types[t] ) || []; type = tns[1]; - namespaces = (tns[2] || "").split( "." ).sort(); + namespaces = ( tns[2] || "" ).split( "." ).sort(); // If event changes its type, use the special event handlers for the changed type special = jQuery.event.special[ type ] || {}; @@ -166,7 +166,7 @@ jQuery.event = { } // Once for each type.namespace in types; type may be omitted - types = (types || "").replace( rhoverHack, "mouseover$1 mouseout$1" ).split(" "); + types = ( types || "" ).replace( rhoverHack, "mouseover$1 mouseout$1" ).split(" "); for ( t = 0; t < types.length; t++ ) { tns = rtypenamespace.exec( types[t] ) || []; type = tns[1]; @@ -347,7 +347,7 @@ jQuery.event = { cur = eventPath[i][0]; event.type = eventPath[i][1]; - handle = (jQuery._data( cur, "events" ) || {})[ event.type ] && jQuery._data( cur, "handle" ); + handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); if ( handle ) { handle.apply( cur, data ); } @@ -401,7 +401,7 @@ jQuery.event = { // Make a writable jQuery.Event from the native event object event = jQuery.event.fix( event || window.event ); - var handlers = ((jQuery._data( this, "events" ) || {})[ event.type ] || []), + var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []), delegateCount = handlers.delegateCount, args = [].slice.call( arguments, 0 ), run_all = !event.exclusive && !event.namespace, @@ -509,8 +509,8 @@ jQuery.event = { doc = eventDoc.documentElement; body = eventDoc.body; - event.pageX = original.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); - event.pageY = original.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); + event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); + event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); } // Add relatedTarget, if necessary @@ -932,9 +932,9 @@ jQuery.fn.extend({ if ( types && types.preventDefault && types.handleObj ) { // ( event ) dispatched jQuery.Event var handleObj = types.handleObj; - jQuery( types.delegateTarget ).off( - handleObj.namespace? handleObj.type + "." + handleObj.namespace : handleObj.type, - handleObj.selector, + jQuery( types.delegateTarget ).off( + handleObj.namespace? handleObj.type + "." + handleObj.namespace : handleObj.type, + handleObj.selector, handleObj.handler ); return this;