Skip to content

Instantly share code, notes, and snippets.

@teone
Created July 16, 2016 00:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save teone/1d1dd67ab0f754f0522326713158dae3 to your computer and use it in GitHub Desktop.
Save teone/1d1dd67ab0f754f0522326713158dae3 to your computer and use it in GitHub Desktop.
returning...
if(this.model.site){
var options_list = this.config.fields.site.options;
var selectVal = _.find(options_list,['id',this.model.site]);
if(selectVal && this.model.name){
return (this.model.name.toLowerCase().indexOf(selectVal.label.toLowerCase()) === 0) ;
}
else{
return false;
}
}
else{
return false;
}
// can be
if(this.model.site){
var options_list = this.config.fields.site.options;
var selectVal = _.find(options_list,['id',this.model.site]);
if(selectVal && this.model.name){
return (this.model.name.toLowerCase().indexOf(selectVal.label.toLowerCase()) === 0) ;
}
}
return false;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment