|
26 | 26 | <!-- The name/key block -->
|
27 | 27 | <div
|
28 | 28 | class="form-group key-value-editor-input"
|
29 |
| - ng-class="{ 'has-error' : (forms.keyValueEditor[uniqueForKey(unique, $index)].$invalid) }"> |
| 29 | + ng-class="{ 'has-error' : (forms.keyValueEditor[uniqueForKey(unique, $index)].$invalid && forms.keyValueEditor[uniqueForKey(unique, $index)].$touched) }"> |
30 | 30 |
|
31 | 31 | <label for="uniqueForKey(unique, $index)" class="sr-only">{{keyPlaceholder}}</label>
|
32 | 32 |
|
|
50 | 50 | spellcheck="false">
|
51 | 51 |
|
52 | 52 | <!-- name/key help block -->
|
53 |
| - <span |
54 |
| - class="help-block key-validation-error" |
55 |
| - ng-show="(forms.keyValueEditor[uniqueForKey(unique, $index)].$error.pattern)"> |
56 |
| - <span class="validation-text">{{ entry.keyValidatorError || keyValidatorError }}</span> |
57 |
| - <span ng-if="entry.keyValidatorErrorTooltip || keyValidatorErrorTooltip" class="help action-inline"> |
58 |
| - <a |
59 |
| - aria-hidden="true" |
60 |
| - data-toggle="tooltip" |
61 |
| - data-placement="top" |
62 |
| - data-original-title="{{entry.keyValidatorErrorTooltip || keyValidatorErrorTooltip}}"> |
63 |
| - <i class="{{entry.keyValidatorErrorTooltipIcon || keyValidatorErrorTooltipIcon}}"></i> |
64 |
| - </a> |
| 53 | + <span ng-show="(forms.keyValueEditor[uniqueForKey(unique, $index)].$touched)"> |
| 54 | + <span |
| 55 | + class="help-block key-validation-error" |
| 56 | + ng-show="(forms.keyValueEditor[uniqueForKey(unique, $index)].$error.pattern)"> |
| 57 | + <span class="validation-text">{{ entry.keyValidatorError || keyValidatorError }}</span> |
| 58 | + <span ng-if="entry.keyValidatorErrorTooltip || keyValidatorErrorTooltip" class="help action-inline"> |
| 59 | + <a |
| 60 | + aria-hidden="true" |
| 61 | + data-toggle="tooltip" |
| 62 | + data-placement="top" |
| 63 | + data-original-title="{{entry.keyValidatorErrorTooltip || keyValidatorErrorTooltip}}"> |
| 64 | + <i class="{{entry.keyValidatorErrorTooltipIcon || keyValidatorErrorTooltipIcon}}"></i> |
| 65 | + </a> |
| 66 | + </span> |
| 67 | + </span> |
| 68 | + <span |
| 69 | + class="help-block key-min-length" |
| 70 | + ng-show="(forms.keyValueEditor[uniqueForKey(unique, $index)].$error.minlength)"> |
| 71 | + <span class="validation-text">Minimum character count is {{keyMinlength}}</span> |
| 72 | + </span> |
| 73 | + <span |
| 74 | + class="help-block key-validation-error" |
| 75 | + ng-show="(forms.keyValueEditor[uniqueForKey(unique, $index)].$error.required)"> |
| 76 | + <span class="validation-text">{{keyRequiredError}}</span> |
65 | 77 | </span>
|
66 |
| - </span> |
67 |
| - <span |
68 |
| - class="help-block key-min-length" |
69 |
| - ng-show="(forms.keyValueEditor[uniqueForKey(unique, $index)].$error.minlength)"> |
70 |
| - <span class="validation-text">Minimum character count is {{keyMinlength}}</span> |
71 |
| - </span> |
72 |
| - <span |
73 |
| - class="help-block key-validation-error" |
74 |
| - ng-show="(forms.keyValueEditor[uniqueForKey(unique, $index)].$error.required)"> |
75 |
| - <span class="validation-text">{{keyRequiredError}}</span> |
76 | 78 | </span>
|
77 | 79 | </div>
|
78 | 80 |
|
79 | 81 | <!-- the value block -->
|
80 | 82 | <div
|
81 | 83 | class="form-group key-value-editor-input"
|
82 |
| - ng-class="forms.keyValueEditor[uniqueForValue(unique, $index)].$invalid ? 'has-error' : ''"> |
| 84 | + ng-class="{ 'has-error': (forms.keyValueEditor[uniqueForValue(unique, $index)].$invalid && forms.keyValueEditor[uniqueForValue(unique, $index)].$touched) }"> |
83 | 85 |
|
84 | 86 | <label for="uniqueForValue(unique, $index)" class="sr-only">{{valuePlaceholder}}</label>
|
85 | 87 |
|
|
176 | 178 | </div>
|
177 | 179 |
|
178 | 180 | <!-- value help block -->
|
179 |
| - <span |
180 |
| - class="help-block value-validation-error" |
181 |
| - ng-show="(forms.keyValueEditor[uniqueForValue(unique, $index)].$error.pattern)"> |
182 |
| - <span class="validation-text">{{ entry.valueValidatorError || valueValidatorError}}</span> |
183 |
| - <span ng-if="entry.valueValidatorErrorTooltip || valueValidatorErrorTooltip" class="help action-inline"> |
184 |
| - <a |
185 |
| - aria-hidden="true" |
186 |
| - data-toggle="tooltip" |
187 |
| - data-placement="top" |
188 |
| - data-original-title="{{entry.valueValidatorErrorTooltip || valueValidatorErrorTooltip}}"> |
189 |
| - <i class="{{entry.valueValidatorErrorTooltipIcon || valueValidatorErrorTooltipIcon}}"></i> |
190 |
| - </a> |
| 181 | + <span ng-show="(forms.keyValueEditor[uniqueForValue(unique, $index)].$touched)"> |
| 182 | + <span |
| 183 | + class="help-block value-validation-error" |
| 184 | + ng-show="(forms.keyValueEditor[uniqueForValue(unique, $index)].$error.pattern)"> |
| 185 | + <span class="validation-text">{{ entry.valueValidatorError || valueValidatorError}}</span> |
| 186 | + <span ng-if="entry.valueValidatorErrorTooltip || valueValidatorErrorTooltip" class="help action-inline"> |
| 187 | + <a |
| 188 | + aria-hidden="true" |
| 189 | + data-toggle="tooltip" |
| 190 | + data-placement="top" |
| 191 | + data-original-title="{{entry.valueValidatorErrorTooltip || valueValidatorErrorTooltip}}"> |
| 192 | + <i class="{{entry.valueValidatorErrorTooltipIcon || valueValidatorErrorTooltipIcon}}"></i> |
| 193 | + </a> |
| 194 | + </span> |
| 195 | + </span> |
| 196 | + <span |
| 197 | + class="help-block value-min-length" |
| 198 | + ng-show="(forms.keyValueEditor[uniqueForValue(unique, $index)].$error.minlength)"> |
| 199 | + <span class="validation-text">Minimum character count is {{valueMinlength}}</span> |
191 | 200 | </span>
|
192 |
| - </span> |
193 |
| - <span |
194 |
| - class="help-block value-min-length" |
195 |
| - ng-show="(forms.keyValueEditor[uniqueForValue(unique, $index)].$error.minlength)"> |
196 |
| - <span class="validation-text">Minimum character count is {{valueMinlength}}</span> |
197 | 201 | </span>
|
198 | 202 | </div>
|
199 | 203 |
|
|
0 commit comments