aboutsummaryrefslogtreecommitdiffstats
path: root/src/event.js
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2010-11-09 11:09:07 -0500
committerJohn Resig <jeresig@gmail.com>2010-11-09 11:09:07 -0500
commitfb48ae8e6cca25fd29ef2b1eb23e9efa7b0eef7c (patch)
tree150abf047642cb0f1e8af19f1c3d0237fe07f9ff /src/event.js
parentb5b3c73db3e4e615e504cd0af08ff6842b104542 (diff)
downloadjquery-fb48ae8e6cca25fd29ef2b1eb23e9efa7b0eef7c.tar.gz
jquery-fb48ae8e6cca25fd29ef2b1eb23e9efa7b0eef7c.zip
Make sure that when multiple variables are being declared that assignments are each done on their own line.
Diffstat (limited to 'src/event.js')
-rw-r--r--src/event.js28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/event.js b/src/event.js
index 04bf168ed..3cfc81759 100644
--- a/src/event.js
+++ b/src/event.js
@@ -378,8 +378,10 @@ jQuery.event = {
jQuery.event.trigger( event, data, parent, true );
} else if ( !event.isDefaultPrevented() ) {
- var target = event.target, old, targetType = type.replace(rnamespaces, ""),
- isClick = jQuery.nodeName(target, "a") && targetType === "click",
+ var old,
+ target = event.target,
+ targetType = type.replace( rnamespaces, "" ),
+ isClick = jQuery.nodeName( target, "a" ) && targetType === "click",
special = jQuery.event.special[ targetType ] || {};
if ( (!special._default || special._default.call( elem, event ) === false) &&
@@ -411,7 +413,9 @@ jQuery.event = {
},
handle: function( event ) {
- var all, handlers, namespaces, namespace_sort = [], namespace_re, events, args = jQuery.makeArray( arguments );
+ var all, handlers, namespaces, namespace_re, events,
+ namespace_sort = [],
+ args = jQuery.makeArray( arguments );
event = args[0] = jQuery.event.fix( event || window.event );
event.currentTarget = this;
@@ -506,7 +510,9 @@ jQuery.event = {
// Calculate pageX/Y if missing and clientX/Y available
if ( event.pageX == null && event.clientX != null ) {
- var doc = document.documentElement, body = document.body;
+ var doc = document.documentElement,
+ body = document.body;
+
event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
}
@@ -712,7 +718,8 @@ if ( !jQuery.support.submitBubbles ) {
setup: function( data, namespaces ) {
if ( this.nodeName.toLowerCase() !== "form" ) {
jQuery.event.add(this, "click.specialSubmit", function( e ) {
- var elem = e.target, type = elem.type;
+ var elem = e.target,
+ type = elem.type;
if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
e.liveFired = undefined;
@@ -721,7 +728,8 @@ if ( !jQuery.support.submitBubbles ) {
});
jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
- var elem = e.target, type = elem.type;
+ var elem = e.target,
+ type = elem.type;
if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
e.liveFired = undefined;
@@ -962,7 +970,8 @@ jQuery.fn.extend({
toggle: function( fn ) {
// Save reference to arguments for access in closure
- var args = arguments, i = 1;
+ var args = arguments,
+ i = 1;
// link all the functions, so any of them can unbind this click handler
while ( i < args.length ) {
@@ -1057,8 +1066,9 @@ jQuery.each(["live", "die"], function( i, name ) {
});
function liveHandler( event ) {
- var stop, maxLevel, elems = [], selectors = [],
- related, match, handleObj, elem, j, i, l, data, close, namespace, ret,
+ var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret,
+ elems = [],
+ selectors = [],
events = jQuery.data( this, this.nodeType ? "events" : "__events__" );
if ( typeof events === "function" ) {