Skip to content

Commit

Permalink
rename validation class. #192
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Apr 22, 2019
1 parent 1f0fbea commit 52b248d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions app/components/doi-titles.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Component from '@ember/component';

export default Component.extend({
validationsClass: null,
validationClass: null,

didReceiveAttrs() {
this._super(...arguments);
Expand All @@ -17,11 +17,11 @@ export default Component.extend({
},
setValidationClass() {
if (this.model.get('validations.attrs.titles.errors').length > 0) {
this.set('validationsClass', 'has-error');
this.set('validationClass', 'has-error');
} else if (this.model.get('validations.attrs.titles.warnings').length > 0) {
this.set('validationsClass', 'has-warning');
this.set('validationClass', 'has-warning');
} else {
this.set('validationsClass', 'has-success');
this.set('validationClass', 'has-success');
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions app/templates/components/doi-title.hbs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{{#if (gt index 0)}}
<div class="input-group">
<input type="text" class="form-control title-field no-error" value={{fragment.title}} oninput={{action "updateTitle" value="target.value"}}/>
<input type="text" class="form-control title-field no-error no-success" value={{fragment.title}} oninput={{action "updateTitle" value="target.value"}}/>
<span class="input-group-btn">
{{#bs-button outline=true onClick=(action "deleteTitle" index)}}{{fa-icon "trash"}}{{/bs-button}}
</span>
</div>
<div class="help-block help-block-fragment no-error">One or more names or titles by which the resource is known.</div>
<div class="help-block help-block-fragment no-error no-success">One or more names or titles by which the resource is known.</div>
{{else}}
<input type="text" class="form-control title-field" value={{fragment.title}} oninput={{action "updateTitle" value="target.value"}}/>

Expand Down
2 changes: 1 addition & 1 deletion app/templates/components/doi-titles.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="form-group {{validationsClass}}">
<div class="form-group {{validationClass}}">
<label class="control-label col-md-3">Title(s)</label>
<div class="col-md-9">
{{#each model.titles as |title index|}}
Expand Down

0 comments on commit 52b248d

Please sign in to comment.