diff options
author | Valerio Virgillito | 2012-06-17 22:31:44 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-06-17 22:31:44 -0700 |
commit | 8fe92b94ce5e1e2857d088752d94e19db7e3d8a8 (patch) | |
tree | d84807aae0b974b5200050972dd94da6066e363b /node_modules/montage/ui/toggle-button.reel/toggle-button.js | |
parent | e570fc8518cf03dd03c15982edcf17c5ba0a293d (diff) | |
download | ninja-8fe92b94ce5e1e2857d088752d94e19db7e3d8a8.tar.gz |
montage v11 merge into ninja
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'node_modules/montage/ui/toggle-button.reel/toggle-button.js')
-rw-r--r-- | node_modules/montage/ui/toggle-button.reel/toggle-button.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/node_modules/montage/ui/toggle-button.reel/toggle-button.js b/node_modules/montage/ui/toggle-button.reel/toggle-button.js index e12e9ba0..640f7b9b 100644 --- a/node_modules/montage/ui/toggle-button.reel/toggle-button.js +++ b/node_modules/montage/ui/toggle-button.reel/toggle-button.js | |||
@@ -16,9 +16,11 @@ var Montage = require("montage").Montage, | |||
16 | /** | 16 | /** |
17 | The ToggleButton component extends the Button component to include state management (pressed or not pressed), and the ability to specify labels and CSS classes for each state. | 17 | The ToggleButton component extends the Button component to include state management (pressed or not pressed), and the ability to specify labels and CSS classes for each state. |
18 | @class module:"montage/ui/toggle-button.reel".ToggleButton | 18 | @class module:"montage/ui/toggle-button.reel".ToggleButton |
19 | @extends module:"montage/button.reel".Button | 19 | @extends module:"montage/ui/button.reel".Button |
20 | */ | 20 | */ |
21 | var ToggleButton = exports.ToggleButton = Montage.create(Button, /** @lends module:"montage/ui/toggle-button.reel".ToggleButton# */ { | 21 | var ToggleButton = exports.ToggleButton = Montage.create(Button, /** @lends module:"montage/ui/toggle-button.reel".ToggleButton# */ { |
22 | hasTemplate: {value: true}, | ||
23 | |||
22 | _pressed: { | 24 | _pressed: { |
23 | value: false | 25 | value: false |
24 | }, | 26 | }, |
@@ -115,11 +117,12 @@ var ToggleButton = exports.ToggleButton = Montage.create(Button, /** @lends modu | |||
115 | */ | 117 | */ |
116 | label: { | 118 | label: { |
117 | get: function() { | 119 | get: function() { |
118 | return Object.getOwnPropertyDescriptor(Object.getPrototypeOf(ToggleButton),"label").get.call(this); | 120 | return Object.getPropertyDescriptor(Button,"label").get.call(this); |
119 | }, | 121 | }, |
120 | set: function(value) { | 122 | set: function(value) { |
121 | // Call super | 123 | // Call super |
122 | Object.getOwnPropertyDescriptor(Object.getPrototypeOf(ToggleButton),"label").set.call(this, value); | 124 | //Object.getOwnPropertyDescriptor(Object.getPrototypeOf(ToggleButton),"label").set.call(this, value); |
125 | Object.getPropertyDescriptor(Button, "label").set.call(this, value); | ||
123 | if (this._pressed === true && this._label === this._unpressedLabel) { | 126 | if (this._pressed === true && this._label === this._unpressedLabel) { |
124 | this.pressed = false; | 127 | this.pressed = false; |
125 | } else if (this._pressed === false && this._label === this._pressedLabel) { | 128 | } else if (this._pressed === false && this._label === this._pressedLabel) { |