diff options
author | Jonathan Duran | 2012-06-20 15:04:45 -0700 |
---|---|---|
committer | Jonathan Duran | 2012-06-20 15:04:45 -0700 |
commit | c6ae80c488621d4ac189cb63309b6258115f823a (patch) | |
tree | dfa26112e1830972fcb212bbb5b17c9a901c645f /node_modules/montage/ui/toggle-button.reel/toggle-button.js | |
parent | 022e714cb5d10cd8575ab9907eddfb184a990b66 (diff) | |
parent | c9852665eadc1acb9c1c881d207c4bd9ef88805f (diff) | |
download | ninja-c6ae80c488621d4ac189cb63309b6258115f823a.tar.gz |
Merge branch 'refs/heads/NINJAmaster' into Timeline-merge-candidate
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) { |