aboutsummaryrefslogtreecommitdiff
path: root/node_modules/montage/ui/radio-button.reel/radio-button.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/montage/ui/radio-button.reel/radio-button.js')
-rwxr-xr-xnode_modules/montage/ui/radio-button.reel/radio-button.js19
1 files changed, 18 insertions, 1 deletions
diff --git a/node_modules/montage/ui/radio-button.reel/radio-button.js b/node_modules/montage/ui/radio-button.reel/radio-button.js
index 8468ee21..9fe43336 100755
--- a/node_modules/montage/ui/radio-button.reel/radio-button.js
+++ b/node_modules/montage/ui/radio-button.reel/radio-button.js
@@ -10,6 +10,23 @@ var Montage = require("montage").Montage,
10 * The Text input 10 * The Text input
11 */ 11 */
12var RadioButton = exports.RadioButton = Montage.create(CheckInput, { 12var RadioButton = exports.RadioButton = Montage.create(CheckInput, {
13 _fakeCheck: {
14 enumerable: false,
15 value: function() {
16 var changeEvent;
17 // NOTE: this may be BAD, modifying the element outside of
18 // the draw loop, but it's what a click/touch would
19 // actually have done
20
21 if (!this._element.checked) {
22 this._element.checked = true;
23 changeEvent = document.createEvent("HTMLEvents");
24 changeEvent.initEvent("change", true, true);
25 this._element.dispatchEvent(changeEvent);
26 }
27 }
28 },
29
13 _checkedSyncedWithInputField: { 30 _checkedSyncedWithInputField: {
14 enumerable: false, 31 enumerable: false,
15 value: false 32 value: false
@@ -75,7 +92,7 @@ var RadioButton = exports.RadioButton = Montage.create(CheckInput, {
75 } 92 }
76 93
77 // Call super 94 // Call super
78 var fn = Object.getPrototypeOf(RadioButton).draw.call(this); 95 Object.getPrototypeOf(RadioButton).draw.call(this);
79 } 96 }
80 } 97 }
81}); 98});