Skip to content

Commit e146362

Browse files
Michael StramelMichael Stramel
authored andcommitted
Updated to use sr-only feedback
1 parent 61b2d09 commit e146362

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

src/directives/decorators/bootstrap/default.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
11
<div class="form-group schema-form-{{form.type}} {{form.htmlClass}}"
22
ng-class="{'has-error': hasError(), 'has-success': hasSuccess(), 'has-feedback': form.feedback !== false }">
3-
<label class="control-label" ng-class="{'sr-only': !showTitle()}">{{form.title}}</label>
3+
<label class="control-label" ng-class="{'sr-only': !showTitle()}" for="{{form.key.slice(-1)[0]}}">{{form.title}}</label>
44

55
<input ng-show="form.key"
66
type="{{form.type}}"
77
step="any"
88
sf-changed="form"
99
placeholder="{{form.placeholder}}"
1010
class="form-control {{form.fieldHtmlClass}}"
11+
id="{{form.key.slice(-1)[0]}}"
1112
ng-model-options="form.ngModelOptions"
1213
ng-model="$$value$$"
1314
ng-disabled="form.readonly"
1415
schema-validate="form"
15-
name="{{form.key.slice(-1)[0]}}">
16+
name="{{form.key.slice(-1)[0]}}"
17+
aria-describedby="{{form.key.slice(-1)[0] + 'Status'}}">
1618
<span ng-if="form.feedback !== false"
1719
class="form-control-feedback"
1820
ng-class="evalInScope(form.feedback) || {'glyphicon': true, 'glyphicon-ok': hasSuccess(), 'glyphicon-remove': hasError() }"
1921
aria-hidden="true"></span>
22+
<span ng-if="hasError() || hasSuccess()"
23+
id="{{form.key.slice(-1)[0] + 'Status'}}"
24+
class="sr-only">{{ hasSuccess() ? '(success)' : '(error)' }}</span>
2025
<div class="help-block"
2126
ng-show="(hasError() && errorMessage(schemaError())) || form.description"
2227
ng-bind-html="(hasError() && errorMessage(schemaError())) || form.description"></div>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="form-group">
2-
<label ng-class="{'sr-only': !showTitle()}">{{form.title}}</label>
3-
<input ng-if="form.type !== 'textarea'" type="text" disabled class="form-control" value="{{$$value$$}}">
2+
<label ng-class="{'sr-only': !showTitle()}" for="{{form.key.slice(-1)[0]}}">{{form.title}}</label>
3+
<input ng-if="form.type !== 'textarea'" type="text" disabled class="form-control" id="{{form.key.slice(-1)[0]}}" value="{{$$value$$}}">
44
<textarea ng-if="form.type === 'textarea'" disabled class="form-control">{{$$value$$}}</textarea>
55
<div class="help-block" ng-show="form.description" ng-bind-html="form.description"></div>
66
</div>

src/directives/decorators/bootstrap/textarea.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<div class="form-group has-feedback {{form.htmlClass}} schema-form-textarea" ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}">
2-
<label ng-class="{'sr-only': !showTitle()}">{{form.title}}</label>
2+
<label ng-class="{'sr-only': !showTitle()}" for="{{form.key.slice(-1)[0]}}">{{form.title}}</label>
33
<textarea class="form-control {{form.fieldHtmlClass}}"
4+
id="{{form.key.slice(-1)[0]}}"
45
sf-changed="form"
56
placeholder="{{form.placeholder}}"
67
ng-disabled="form.readonly"

0 commit comments

Comments
 (0)