3 Polymer('core-range', {
6 * The number that represents the current value.
15 * The number that indicates the minimum value of the range.
24 * The number that indicates the maximum value of the range.
33 * Specifies the value granularity of the range's value.
42 * Returns the ratio of the value.
51 'value min max step': 'update'
54 calcRatio: function(value
) {
55 return (this.clampValue(value
) - this.min
) / (this.max
- this.min
);
58 clampValue: function(value
) {
59 return Math
.min(this.max
, Math
.max(this.min
, this.calcStep(value
)));
62 calcStep: function(value
) {
63 return this.step
? (Math
.round(value
/ this.step
) / (1 / this.step
)) : value
;
66 validateValue: function() {
67 var v
= this.clampValue(this.value
);
68 this.value
= this.oldValue
= isNaN(v
) ? this.oldValue
: v
;
69 return this.value
!== v
;
74 this.ratio
= this.calcRatio(this.value
) * 100;