Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save trueqbit/0280c0feefcdc61c841bcd698b673e8e to your computer and use it in GitHub Desktop.
Save trueqbit/0280c0feefcdc61c841bcd698b673e8e to your computer and use it in GitHub Desktop.
jsviews-jqueryui-widgets.js.v0.9.85 (Beta).diff
diff --git a/jsviews-jqueryui-widgets.js b/jsviews-jqueryui-widgets.js
index 3340f2b..dce644a 100644
--- a/jsviews-jqueryui-widgets.js
+++ b/jsviews-jqueryui-widgets.js
@@ -242,7 +242,14 @@ checkbox: {
mainElement: "input",
linkedElement: "input",
setSize: true,
- onAfterLink: checkboxRadioOnAfterLink
+ onAfterLink: checkboxRadioOnAfterLink,
+ setValue: function(val) {
+ if (val !== undefined) {
+ var elem = this.mainElem[0];
+ elem.checked = val && val !== "false";
+ }
+ this.widget.refresh();
+ }
},
radio: {
baseTag: "widget",
@@ -270,11 +277,9 @@ radio: {
},
onAfterLink: checkboxRadioOnAfterLink,
setValue: function(val) {
- var elem = this.mainElem[0];
if (val !== undefined) {
- elem.checked = elem.type === "radio"
- ? (val === elem.value)
- : val && val !== "false";
+ var elem = this.mainElem[0];
+ elem.checked = val === elem.value;
}
this.widget.refresh();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment