diff options
Diffstat (limited to 'js/components/ui/label-checkbox.reel/label-checkbox.js')
-rwxr-xr-x | js/components/ui/label-checkbox.reel/label-checkbox.js | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/js/components/ui/label-checkbox.reel/label-checkbox.js b/js/components/ui/label-checkbox.reel/label-checkbox.js index 82c01262..21b72cb5 100755 --- a/js/components/ui/label-checkbox.reel/label-checkbox.js +++ b/js/components/ui/label-checkbox.reel/label-checkbox.js | |||
@@ -42,6 +42,25 @@ exports.LabelCheckbox = Montage.create(Component, { | |||
42 | } | 42 | } |
43 | }, | 43 | }, |
44 | 44 | ||
45 | _enabled: { | ||
46 | enumerable: false, | ||
47 | value: true | ||
48 | }, | ||
49 | |||
50 | enabled: { | ||
51 | enumerable: true, | ||
52 | serializable: true, | ||
53 | get: function() { | ||
54 | return this._enabled; | ||
55 | }, | ||
56 | set: function(value) { | ||
57 | if(value !== this._enabled) { | ||
58 | this._enabled = value; | ||
59 | this.needsDraw = true; | ||
60 | } | ||
61 | } | ||
62 | }, | ||
63 | |||
45 | value: { | 64 | value: { |
46 | value: false | 65 | value: false |
47 | }, | 66 | }, |
@@ -52,7 +71,7 @@ exports.LabelCheckbox = Montage.create(Component, { | |||
52 | e.initEvent("change", true, true); | 71 | e.initEvent("change", true, true); |
53 | e.type = "change"; | 72 | e.type = "change"; |
54 | e.wasSetByCode = false; | 73 | e.wasSetByCode = false; |
55 | this.value = e.value = this._checkbox.checked; | 74 | this.checked = this.value = e.value = this._checkbox.checked; |
56 | this.dispatchEvent(e); | 75 | this.dispatchEvent(e); |
57 | } | 76 | } |
58 | }, | 77 | }, |
@@ -61,6 +80,7 @@ exports.LabelCheckbox = Montage.create(Component, { | |||
61 | value: function() { | 80 | value: function() { |
62 | this._labelText.value = this.label; | 81 | this._labelText.value = this.label; |
63 | this._checkbox.checked = this.checked; | 82 | this._checkbox.checked = this.checked; |
83 | this._checkbox.disabled = !this._enabled; | ||
64 | } | 84 | } |
65 | 85 | ||
66 | } | 86 | } |