diff options
author | Valerio Virgillito | 2012-03-08 13:56:09 -0800 |
---|---|---|
committer | Valerio Virgillito | 2012-03-08 13:56:09 -0800 |
commit | 22a66cb6e243a3f1c867b62e3942fd2e828019d9 (patch) | |
tree | 4b2f8bf0d8306964f35435dac3d1f6592b3dee19 /node_modules/montage/ui/bluemoon/progress.reel | |
parent | cef07085443b7c31e878daaad083b7408c57e104 (diff) | |
download | ninja-22a66cb6e243a3f1c867b62e3942fd2e828019d9.tar.gz |
integrating v0.7 montage into ninja
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'node_modules/montage/ui/bluemoon/progress.reel')
-rw-r--r-- | node_modules/montage/ui/bluemoon/progress.reel/progress.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/node_modules/montage/ui/bluemoon/progress.reel/progress.js b/node_modules/montage/ui/bluemoon/progress.reel/progress.js index 8bc68b05..20c60d94 100644 --- a/node_modules/montage/ui/bluemoon/progress.reel/progress.js +++ b/node_modules/montage/ui/bluemoon/progress.reel/progress.js | |||
@@ -43,8 +43,8 @@ exports.Progress = Montage.create(Component,/** @lends module:"montage/ui/bluemo | |||
43 | set: function(val) { | 43 | set: function(val) { |
44 | if(val !== this._value) { | 44 | if(val !== this._value) { |
45 | this._value = val; | 45 | this._value = val; |
46 | if(this._value > this._maximumValue) { | 46 | if(this._value > this._max) { |
47 | this._value = this._maximumValue; | 47 | this._value = this._max; |
48 | } | 48 | } |
49 | if(this._value < 0) { | 49 | if(this._value < 0) { |
50 | this._value = 0; | 50 | this._value = 0; |
@@ -57,7 +57,7 @@ exports.Progress = Montage.create(Component,/** @lends module:"montage/ui/bluemo | |||
57 | Description TODO | 57 | Description TODO |
58 | @private | 58 | @private |
59 | */ | 59 | */ |
60 | _maximumValue: { | 60 | _max: { |
61 | enumerable: false, | 61 | enumerable: false, |
62 | value: 100 | 62 | value: 100 |
63 | }, | 63 | }, |
@@ -66,15 +66,15 @@ exports.Progress = Montage.create(Component,/** @lends module:"montage/ui/bluemo | |||
66 | @type {Function} | 66 | @type {Function} |
67 | @default {Number} 100 | 67 | @default {Number} 100 |
68 | */ | 68 | */ |
69 | maximumValue: { | 69 | max: { |
70 | get: function() { | 70 | get: function() { |
71 | return this._maximumValue; | 71 | return this._max; |
72 | }, | 72 | }, |
73 | set: function(val) { | 73 | set: function(val) { |
74 | if(val !== this._maximumValue) { | 74 | if(val !== this._max) { |
75 | this._maximumValue = val; | 75 | this._max = val; |
76 | if(this._maximumValue <= 0) { | 76 | if(this._max <= 0) { |
77 | this._maximumValue = 1; // Prevent divide by zero errors | 77 | this._max = 1; // Prevent divide by zero errors |
78 | } | 78 | } |
79 | this.needsDraw = true; | 79 | this.needsDraw = true; |
80 | } | 80 | } |
@@ -120,7 +120,7 @@ exports.Progress = Montage.create(Component,/** @lends module:"montage/ui/bluemo | |||
120 | draw: { | 120 | draw: { |
121 | enumerable: false, | 121 | enumerable: false, |
122 | value: function() { | 122 | value: function() { |
123 | var ratio = this._value / this._maximumValue; | 123 | var ratio = this._value / this._max; |
124 | // constrain to interval [0, 1] | 124 | // constrain to interval [0, 1] |
125 | ratio = Math.min(Math.max(ratio, 0), 1); | 125 | ratio = Math.min(Math.max(ratio, 0), 1); |
126 | // map into [0, 100] | 126 | // map into [0, 100] |