Skip to content

Added labelHtmlClass #327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 27, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,7 @@ General options most field types can handle:
// and their items will inherit it.
htmlClass: "street foobar", // CSS Class(es) to be added to the container div
fieldHtmlClass: "street" // CSS Class(es) to be added to field input (or similar)
labelHtmlClass: "street" // CSS Class(es) to be added to the label of the field (or similar)
copyValueTo: ["address.street"], // Copy values to these schema keys.
condition: "person.age < 18" // Show or hide field depending on an angular expression
}
Expand Down
2 changes: 1 addition & 1 deletion src/directives/decorators/bootstrap/checkbox.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="checkbox schema-form-checkbox {{form.htmlClass}}"
ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}">
<label>
<label class="{{form.labelHtmlClass}}">
<input type="checkbox"
sf-changed="form"
ng-disabled="form.readonly"
Expand Down
2 changes: 1 addition & 1 deletion src/directives/decorators/bootstrap/checkboxes.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div sf-array="form" ng-model="$$value$$"
class="form-group schema-form-checkboxes {{form.htmlClass}}"
ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}">
<label class="control-label" ng-show="showTitle()">{{form.title}}</label>
<label class="control-label {{form.labelHtmlClass}}" ng-show="showTitle()">{{form.title}}</label>
<div class="checkbox" ng-repeat="val in titleMapValues track by $index" >
<label>
<input type="checkbox"
Expand Down
2 changes: 1 addition & 1 deletion src/directives/decorators/bootstrap/default.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="form-group schema-form-{{form.type}} {{form.htmlClass}}"
ng-class="{'has-error': hasError(), 'has-success': hasSuccess(), 'has-feedback': form.feedback !== false }">
<label class="control-label" ng-class="{'sr-only': !showTitle()}" for="{{form.key.slice(-1)[0]}}">{{form.title}}</label>
<label class="control-label {{form.labelHtmlClass}}" ng-class="{'sr-only': !showTitle()}" for="{{form.key.slice(-1)[0]}}">{{form.title}}</label>

<input ng-if="!form.fieldAddonLeft && !form.fieldAddonRight"
ng-show="form.key"
Expand Down
2 changes: 1 addition & 1 deletion src/directives/decorators/bootstrap/radio-buttons.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="form-group schema-form-radiobuttons {{form.htmlClass}}"
ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}">
<div>
<label class="control-label" ng-show="showTitle()">{{form.title}}</label>
<label class="control-label {{form.labelHtmlClass}}" ng-show="showTitle()">{{form.title}}</label>
</div>
<div class="btn-group">
<label class="btn {{ (item.value === $$value$$) ? form.style.selected || 'btn-default' : form.style.unselected || 'btn-default'; }}"
Expand Down
2 changes: 1 addition & 1 deletion src/directives/decorators/bootstrap/radios-inline.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="form-group schema-form-radios-inline {{form.htmlClass}}"
ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}">
<label class="control-label" ng-show="showTitle()">{{form.title}}</label>
<label class="control-label {{form.labelHtmlClass}}" ng-show="showTitle()">{{form.title}}</label>
<div>
<label class="radio-inline" ng-repeat="item in form.titleMap" >
<input type="radio"
Expand Down
2 changes: 1 addition & 1 deletion src/directives/decorators/bootstrap/radios.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="form-group schema-form-radios {{form.htmlClass}}" ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}">
<label class="control-label" ng-show="showTitle()">{{form.title}}</label>
<label class="control-label {{form.labelHtmlClass}}" ng-show="showTitle()">{{form.title}}</label>
<div class="radio" ng-repeat="item in form.titleMap" >
<label>
<input type="radio"
Expand Down
2 changes: 1 addition & 1 deletion src/directives/decorators/bootstrap/select.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="form-group {{form.htmlClass}} schema-form-select"
ng-class="{'has-error': hasError(), 'has-success': hasSuccess(), 'has-feedback': form.feedback !== false}">
<label class="control-label" ng-show="showTitle()">
<label class="control-label {{form.labelHtmlClass}}" ng-show="showTitle()">
{{form.title}}
</label>
<select ng-model="$$value$$"
Expand Down
2 changes: 1 addition & 1 deletion src/directives/decorators/bootstrap/textarea.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="form-group has-feedback {{form.htmlClass}} schema-form-textarea" ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}">
<label ng-class="{'sr-only': !showTitle()}" for="{{form.key.slice(-1)[0]}}">{{form.title}}</label>
<label class="{{form.labelHtmlClass}}" ng-class="{'sr-only': !showTitle()}" for="{{form.key.slice(-1)[0]}}">{{form.title}}</label>

<textarea ng-if="!form.fieldAddonLeft && !form.fieldAddonRight"
class="form-control {{form.fieldHtmlClass}}"
Expand Down