Skip to content

Instantly share code, notes, and snippets.

@dustinc
Created November 12, 2014 23:15
Show Gist options
  • Save dustinc/ec4c4b7046a52f367c84 to your computer and use it in GitHub Desktop.
Save dustinc/ec4c4b7046a52f367c84 to your computer and use it in GitHub Desktop.
// 1
renderMethod: function() {
var self = this;
if(this.render_method) return this.render_method;
_(this.get('files').each(function(file) {
if(file.active) {
self.render_method = file.form_render || 'Mapped';
}
});
return this.render_method;
};
// 2
renderMethod: function() {
var self = this;
if(!this.render_method) {
_(this.get('files').each(function(file) {
if(file.active) {
self.render_method = file.form_render || 'Mapped';
}
});
}
return this.render_method;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment