diff options
author | Nivesh Rajbhandari | 2012-04-25 13:34:04 -0700 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-04-25 13:34:04 -0700 |
commit | 32a24988add5ba0ecf80caa31871cdd90e3eea5b (patch) | |
tree | fbf05f2dfc91e57ab9598046ff16798ea0ae1966 /node_modules/montage/ui | |
parent | 60d6346a78fb5257eaf36f17a5fcb764a342c012 (diff) | |
parent | d3a6350163ada5644d34ed8d5c2a00cef4db2afc (diff) | |
download | ninja-32a24988add5ba0ecf80caa31871cdd90e3eea5b.tar.gz |
Merge branch 'refs/heads/ninja-internal' into WebGLMaterials
Diffstat (limited to 'node_modules/montage/ui')
50 files changed, 5799 insertions, 1876 deletions
diff --git a/node_modules/montage/ui/bluemoon/slider.reel/slider.js b/node_modules/montage/ui/bluemoon/slider.reel/slider.js index 56c4faa8..1a0e3d6e 100644 --- a/node_modules/montage/ui/bluemoon/slider.reel/slider.js +++ b/node_modules/montage/ui/bluemoon/slider.reel/slider.js | |||
@@ -4,7 +4,7 @@ | |||
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | 4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. |
5 | </copyright> */ | 5 | </copyright> */ |
6 | /** | 6 | /** |
7 | @module "montage/ui/bluemoon/slider.reel" | 7 | @module "montage/ui/bluemoon/slider.reel" |
8 | @requires montage/core/core | 8 | @requires montage/core/core |
9 | @requires montage/ui/component | 9 | @requires montage/ui/component |
10 | */ | 10 | */ |
@@ -199,6 +199,9 @@ exports.Slider = Montage.create(Component,/** @lends module:"montage/ui/bluemoon | |||
199 | }, | 199 | }, |
200 | set: function (value) { | 200 | set: function (value) { |
201 | if (value !== this._minValue) { | 201 | if (value !== this._minValue) { |
202 | if(String.isString(value)) { | ||
203 | value = parseFloat(value); | ||
204 | } | ||
202 | this._minValue = value; | 205 | this._minValue = value; |
203 | this._valueRange = null; | 206 | this._valueRange = null; |
204 | this.needsDraw = true; | 207 | this.needsDraw = true; |
@@ -226,6 +229,9 @@ exports.Slider = Montage.create(Component,/** @lends module:"montage/ui/bluemoon | |||
226 | }, | 229 | }, |
227 | set: function (value) { | 230 | set: function (value) { |
228 | if (value !== this._maxValue) { | 231 | if (value !== this._maxValue) { |
232 | if(String.isString(value)) { | ||
233 | value = parseFloat(value); | ||
234 | } | ||
229 | this._maxValue = value; | 235 | this._maxValue = value; |
230 | this._valueRange = null; | 236 | this._valueRange = null; |
231 | this.needsDraw = true; | 237 | this.needsDraw = true; |
@@ -288,6 +294,9 @@ exports.Slider = Montage.create(Component,/** @lends module:"montage/ui/bluemoon | |||
288 | }, | 294 | }, |
289 | set: function (value) { | 295 | set: function (value) { |
290 | if (!isNaN(value)) { | 296 | if (!isNaN(value)) { |
297 | if(String.isString(value)) { | ||
298 | value = parseFloat(value); | ||
299 | } | ||
291 | if (value !== this._value) { | 300 | if (value !== this._value) { |
292 | this._value = parseFloat(value); | 301 | this._value = parseFloat(value); |
293 | this.needsDraw = true; | 302 | this.needsDraw = true; |
@@ -450,7 +459,8 @@ exports.Slider = Montage.create(Component,/** @lends module:"montage/ui/bluemoon | |||
450 | */ | 459 | */ |
451 | handleMousemove: { | 460 | handleMousemove: { |
452 | value: function (event) { | 461 | value: function (event) { |
453 | this.value = this._value + ((event.clientX - this._cursorPosition) * (this.valueRange)) / this._width; | 462 | this.value = this.value + ((event.clientX - this._cursorPosition) * (this.valueRange)) / this._width; |
463 | |||
454 | this._cursorPosition = event.clientX; | 464 | this._cursorPosition = event.clientX; |
455 | event.preventDefault(); | 465 | event.preventDefault(); |
456 | event.stopPropagation(); | 466 | event.stopPropagation(); |
diff --git a/node_modules/montage/ui/button.reel/button.js b/node_modules/montage/ui/button.reel/button.js index 5da92482..315cf505 100644 --- a/node_modules/montage/ui/button.reel/button.js +++ b/node_modules/montage/ui/button.reel/button.js | |||
@@ -13,6 +13,24 @@ var Montage = require("montage").Montage, | |||
13 | */ | 13 | */ |
14 | var Button = exports.Button = Montage.create(NativeControl, { | 14 | var Button = exports.Button = Montage.create(NativeControl, { |
15 | 15 | ||
16 | /** | ||
17 | @event | ||
18 | @name action | ||
19 | @param {Event} event | ||
20 | |||
21 | Dispatched when the button is activated through a mouse click, finger tap, | ||
22 | or when focused and the spacebar is pressed. | ||
23 | */ | ||
24 | |||
25 | /** | ||
26 | @event | ||
27 | @name hold | ||
28 | @param {Event} event | ||
29 | |||
30 | Dispatched when the button is pressed for a period of time, set by | ||
31 | {@link holdTimeout}. | ||
32 | */ | ||
33 | |||
16 | /** | 34 | /** |
17 | Description TODO | 35 | Description TODO |
18 | @private | 36 | @private |
@@ -105,6 +123,23 @@ var Button = exports.Button = Montage.create(NativeControl, { | |||
105 | }, | 123 | }, |
106 | 124 | ||
107 | /** | 125 | /** |
126 | How long a press has to last for a hold event to be dispatched | ||
127 | */ | ||
128 | holdTimeout: { | ||
129 | get: function() { | ||
130 | return this._pressComposer.longPressTimeout; | ||
131 | }, | ||
132 | set: function(value) { | ||
133 | this._pressComposer.longPressTimeout = value; | ||
134 | } | ||
135 | }, | ||
136 | |||
137 | _pressComposer: { | ||
138 | enumberable: false, | ||
139 | value: null | ||
140 | }, | ||
141 | |||
142 | /** | ||
108 | True when the button is being interacted with, either through mouse click or | 143 | True when the button is being interacted with, either through mouse click or |
109 | touch event. | 144 | touch event. |
110 | @private | 145 | @private |
@@ -129,13 +164,28 @@ var Button = exports.Button = Montage.create(NativeControl, { | |||
129 | } | 164 | } |
130 | }, | 165 | }, |
131 | 166 | ||
167 | didCreate: { | ||
168 | value: function() { | ||
169 | this._pressComposer = PressComposer.create(); | ||
170 | this.addComposer(this._pressComposer); | ||
171 | } | ||
172 | }, | ||
173 | |||