This repository was archived by the owner on Apr 30, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +13
-12
lines changed Expand file tree Collapse file tree 2 files changed +13
-12
lines changed Original file line number Diff line number Diff line change
1
+ # 4.0.9
2
+
3
+ - Allowing descriptions on all types
4
+
1
5
# 4.0.8
2
6
3
7
- Fixing issue #17 with form control not getting set on multiCheckbox and radio types.
Original file line number Diff line number Diff line change @@ -3,24 +3,21 @@ export default ngModule => {
3
3
4
4
function addDescriptionManipulator ( formlyConfig ) {
5
5
formlyConfig . templateManipulators . preWrapper . push ( function ariaDescribedBy ( template , options , scope ) {
6
- if ( angular . isDefined ( options . templateOptions . description ) &&
7
- options . type !== 'radio' && options . type !== 'checkbox' ) {
6
+ if ( angular . isDefined ( options . templateOptions . description ) ) {
8
7
var el = document . createElement ( 'div' ) ;
9
8
el . appendChild ( angular . element ( template ) [ 0 ] ) ;
9
+ el . appendChild ( angular . element (
10
+ '<p id="' + scope . id + '_description"' +
11
+ 'class="help-block"' +
12
+ 'ng-if="to.description">' +
13
+ '{{to.description}}' +
14
+ '</p>'
15
+ ) [ 0 ] ) ;
10
16
var modelEls = angular . element ( el . querySelectorAll ( '[ng-model]' ) ) ;
11
17
if ( modelEls ) {
12
- el . appendChild ( angular . element (
13
- '<p id="' + scope . id + '_description"' +
14
- 'class="help-block"' +
15
- 'ng-if="to.description">' +
16
- '{{to.description}}' +
17
- '</p>'
18
- ) [ 0 ] ) ;
19
18
modelEls . attr ( 'aria-describedby' , scope . id + '_description' ) ;
20
- return el . innerHTML ;
21
- } else {
22
- return template ;
23
19
}
20
+ return el . innerHTML ;
24
21
} else {
25
22
return template ;
26
23
}
You can’t perform that action at this time.
0 commit comments