Skip to content

Commit

Permalink
Fix (?) for radio buttons in repeat groups, in certain templates, wer…
Browse files Browse the repository at this point in the history
…en't correctly picking up defaults, and targetting the wrong repeat.
  • Loading branch information
cheesegrits committed Nov 18, 2017
1 parent 978cd6e commit 93068f7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion plugins/fabrik_element/radiobutton/radiobutton-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion plugins/fabrik_element/radiobutton/radiobutton.js
Expand Up @@ -148,7 +148,10 @@ define(['jquery', 'fab/elementlist'], function (jQuery, FbElementList) {
}
this._getSubElements().each(function (sub) {
if (sub.value === v) {
sub.checked = 'checked';
sub.set('checked', true);
}
else {
sub.set('checked', false);
}
});
},
Expand Down Expand Up @@ -183,6 +186,13 @@ define(['jquery', 'fab/elementlist'], function (jQuery, FbElementList) {
this.watchAddToggle();
this.watchAdd();
}
this._getSubElements().each(function (sub, i) {
sub.id = this.options.element + '_input_' + i;
var label = sub.getParent('label');
if (label) {
label.htmlFor = sub.id;
}
}.bind(this));
this.parent(c);
this.btnGroup();
},
Expand Down

0 comments on commit 93068f7

Please sign in to comment.