Make sure that when multiple variables are being declared that assignments are each done on their own line.

This commit is contained in:
John Resig 2010-11-09 11:09:07 -05:00
parent b5b3c73db3
commit fb48ae8e6c
12 changed files with 98 additions and 45 deletions

View file

@ -55,7 +55,9 @@ jQuery.fn.extend({
elem.className = value;
} else {
var className = " " + elem.className + " ", setClass = elem.className;
var className = " " + elem.className + " ",
setClass = elem.className;
for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
setClass += " " + classNames[c];
@ -103,7 +105,8 @@ jQuery.fn.extend({
},
toggleClass: function( value, stateVal ) {
var type = typeof value, isBool = typeof stateVal === "boolean";
var type = typeof value,
isBool = typeof stateVal === "boolean";
if ( jQuery.isFunction( value ) ) {
return this.each(function(i) {
@ -115,7 +118,9 @@ jQuery.fn.extend({
return this.each(function() {
if ( type === "string" ) {
// toggle individual class names
var className, i = 0, self = jQuery(this),
var className,
i = 0,
self = jQuery( this ),
state = stateVal,
classNames = value.split( rspaces );