Skip to content

Commit

Permalink
fixed &= to =
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshy Cyriac committed Apr 16, 2012
1 parent 4e7cb55 commit b2edcdf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions jquery-rave-0.1.js
Expand Up @@ -168,7 +168,7 @@
if (typeof scope === 'undefined'){
inScope = true;
} else{
inScope = jQuery(scope).find($(field.targets[0])).length > 0;
inScope = jQuery(scope).parents($(field.targets[0])).length > 0;
}
// update skip info
field.skip = !inScope || methods.isSkipped(field);
Expand Down Expand Up @@ -201,7 +201,7 @@
var valid = true;
jQuery.each(boundFields, function(key, value) {
//boundField must be valid or currently skipped
valid &= value.state === 'valid' || value.skip;

This comment has been minimized.

Copy link
@zueblin

zueblin May 1, 2012

IMO it needs to be valid &= value.state, so that once valid is false, it can not become true again.

valid = value.state === 'valid' || value.skip;
methods.log(key + " is " + value.state);
});
methods.log("global state is:" + valid);
Expand Down Expand Up @@ -257,14 +257,13 @@
},

log : function(msg){
var debug = false;
var debug = true;
if (debug === true){
console.log(msg);
}
}


};

/**
* Default configuration depending on field type
*
Expand Down Expand Up @@ -299,6 +298,7 @@
delayValidation : 0
}
};

$.fn.validate = function(method) {
// Method calling logic
if (methods[method]) {
Expand Down

0 comments on commit b2edcdf

Please sign in to comment.