Skip to content

Commit

Permalink
Fix for radiobutton setting default in repeat groups.
Browse files Browse the repository at this point in the history
  • Loading branch information
cheesegrits committed Nov 11, 2017
1 parent 990c1ea commit d86dec4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 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.

22 changes: 9 additions & 13 deletions plugins/fabrik_element/radiobutton/radiobutton.js
Expand Up @@ -154,6 +154,10 @@ define(['jquery', 'fab/elementlist'], function (jQuery, FbElementList) {
},

update: function (val) {
if (typeOf(val) === 'array')
{
val = val.shift();
}
this.setValue(val);
if (!this.options.editable) {
if (val === '') {
Expand All @@ -165,19 +169,11 @@ define(['jquery', 'fab/elementlist'], function (jQuery, FbElementList) {
} else {
if (this.options.btnGroup) {
var els = this._getSubElements();
if (typeOf(val) === 'array') {
els.each(function (el) {
if (val.contains(el.value)) {
this.setButtonGroupCSS(el);
}
}.bind(this));
} else {
els.each(function (el) {
if (el.value === val) {
this.setButtonGroupCSS(el);
}
}.bind(this));
}
els.each(function (el) {
if (el.value === val) {
this.setButtonGroupCSS(el);
}
}.bind(this));
}
}
},
Expand Down

0 comments on commit d86dec4

Please sign in to comment.