diff options
author | Jose Antonio Marquez | 2012-04-24 10:06:53 -0700 |
---|---|---|
committer | Jose Antonio Marquez | 2012-04-24 10:06:53 -0700 |
commit | 4c15e77bdb7f4e0558f3749994a8a37b207b97ae (patch) | |
tree | 593ab4917fb5cc3ef8ee36822b56c6edd30c33a5 /node_modules/montage/ui/bluemoon/slider.reel/slider.js | |
parent | 36d50b6599ab98559c76e1fe57b1bb131c4433da (diff) | |
parent | 55e6d621b9555abac06ab4adff44dfe29a78ec4e (diff) | |
download | ninja-4c15e77bdb7f4e0558f3749994a8a37b207b97ae.tar.gz |
Merge branch 'refs/heads/Ninja-Internal' into Document
Diffstat (limited to 'node_modules/montage/ui/bluemoon/slider.reel/slider.js')
-rw-r--r-- | node_modules/montage/ui/bluemoon/slider.reel/slider.js | 14 |
1 files changed, 12 insertions, 2 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(); |