Skip to content

Commit 24c6bf3

Browse files
Michael StramelMichael Stramel
authored andcommitted
Fixed tests and logic of displaying sr-only
1 parent 7ebc8dc commit 24c6bf3

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/directives/decorators/bootstrap/default.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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()}">{{form.title}}</label>
44

55
<input ng-show="form.key"
66
type="{{form.type}}"

src/directives/decorators/bootstrap/readonly.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="form-group">
2-
<label ng-class="{'sr-only': showTitle()}">{{form.title}}</label>
2+
<label ng-class="{'sr-only': !showTitle()}">{{form.title}}</label>
33
<input ng-if="form.type !== 'textarea'" type="text" disabled class="form-control" 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>

src/directives/decorators/bootstrap/textarea.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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()}">{{form.title}}</label>
33
<textarea class="form-control {{form.fieldHtmlClass}}"
44
sf-changed="form"
55
placeholder="{{form.placeholder}}"

test/directives/schema-form-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ describe('directive',function(){
779779
$rootScope.$apply();
780780

781781
tmpl.children().length.should.be.equal(2);
782-
tmpl.children().eq(0).children().eq(0).find('label').hasClass('ng-hide').should.be.true;
782+
tmpl.children().eq(0).children().eq(0).find('label').hasClass('sr-only').should.be.true;
783783
tmpl.children().eq(1).children().eq(0).find('label').hasClass('ng-hide').should.be.true;
784784
});
785785
});

0 commit comments

Comments
 (0)