Created
May 1, 2015 20:20
-
-
Save fogonthedowns/d7a1ddb28129c82fad0c to your computer and use it in GitHub Desktop.
example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
warnValidations: function(value) { | |
this.setState({warnErrorTypes:[]}) | |
if (value["fact_interviews"] == "0") { | |
this.setWarnTypes(2) | |
} else if (Number(value["fact_interviews"]) >= 20) { | |
this.setWarnTypes(3) | |
} | |
console.log(this.state.warnErrorTypes) | |
}, | |
setWarnTypes:function(type){ | |
var warnErrorTypes = this.state.warnErrorTypes | |
warnErrorTypes.push(type) | |
warnErrorTypes = this.toUnique(warnErrorTypes) | |
this.setState({ warnErrorTypes: warnErrorTypes }) | |
}, | |
toUnique:function(a,b,c){//array,placeholder,placeholder | |
b=a.length; | |
while(c=--b)while(c--)a[b]!==a[c]||a.splice(c,1); | |
return a // not needed ;) | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment