discourse/app/assets/javascripts/wizard/models/wizard-field.js.es6

18 lines
333 B
Text
Raw Normal View History

2016-08-25 13:14:56 -04:00
import ValidState from 'wizard/mixins/valid-state';
export default Ember.Object.extend(ValidState, {
id: null,
type: null,
value: null,
required: null,
check() {
if (!this.get('required')) {
return this.setValid(true);
}
const val = this.get('value');
this.setValid(val && val.length > 0);
}
});