Merge pull request #5912 from HParker/form-default-class-to-none

Form default error class to none
This commit is contained in:
Kevin Ansfield 2015-10-13 19:28:43 +01:00
commit e09cd70cd0

View File

@ -11,7 +11,11 @@ import ValidationStateMixin from 'ghost/mixins/validation-state';
export default Ember.Component.extend(ValidationStateMixin, {
classNameBindings: ['errorClass'],
errorClass: Ember.computed('hasError', function () {
return this.get('hasError') ? 'error' : 'success';
errorClass: Ember.computed('hasError', 'hasValidated.[]', function () {
if (this.hasValidated.contains(this.get('property'))) {
return this.get('hasError') ? 'error' : 'success';
} else {
return '';
}
})
});