aboutsummaryrefslogtreecommitdiff
path: root/js/components/ui/label-checkbox.reel
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-05-17 11:10:15 -0700
committerNivesh Rajbhandari2012-05-17 11:10:15 -0700
commit3d36ca3feb7a2cabd7d64335b2417637bd9aa906 (patch)
treeb89119d747de0c7333a8cbde4a7689c5fb102d5c /js/components/ui/label-checkbox.reel
parent2ba4a6fab3b81b537521760ee5f95f1bc80027f9 (diff)
parent0e8ca026098e7abfaeb642643a21977490782922 (diff)
downloadninja-3d36ca3feb7a2cabd7d64335b2417637bd9aa906.tar.gz
Merge branch 'refs/heads/dom-architecture-master' into Dom-Architecture
Diffstat (limited to 'js/components/ui/label-checkbox.reel')
-rwxr-xr-xjs/components/ui/label-checkbox.reel/label-checkbox.js22
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 }