7 Polymer.IronRangeBehavior
13 * The number that represents the current secondary progress.
30 * Use an indeterminate progress indicator.
35 observer: '_toggleIndeterminate'
39 * True if the progress is disabled.
44 reflectToAttribute: true,
45 observer: '_disabledChanged'
50 '_progressChanged(secondaryProgress, value, min, max)'
57 _toggleIndeterminate: function(indeterminate) {
58 // If we use attribute/class binding, the animation sometimes doesn't translate properly
59 // on Safari 7.1. So instead, we toggle the class here in the update method.
60 this.toggleClass('indeterminate', indeterminate, this.$.primaryProgress);
63 _transformProgress: function(progress, ratio) {
64 var transform = 'scaleX(' + (ratio / 100) + ')';
65 progress.style.transform = progress.style.webkitTransform = transform;
68 _mainRatioChanged: function(ratio) {
69 this._transformProgress(this.$.primaryProgress, ratio);
72 _progressChanged: function(secondaryProgress, value, min, max) {
73 secondaryProgress = this._clampValue(secondaryProgress);
74 value = this._clampValue(value);
76 var secondaryRatio = this._calcRatio(secondaryProgress) * 100;
77 var mainRatio = this._calcRatio(value) * 100;
79 this._setSecondaryRatio(secondaryRatio);
80 this._transformProgress(this.$.secondaryProgress, secondaryRatio);
81 this._transformProgress(this.$.primaryProgress, mainRatio);
83 this.secondaryProgress = secondaryProgress;
85 this.setAttribute('aria-valuenow', value);
86 this.setAttribute('aria-valuemin', min);
87 this.setAttribute('aria-valuemax', max);
90 _disabledChanged: function(disabled) {
91 this.$.progressContainer.setAttribute('aria-disabled', disabled ? 'true' : 'false');
94 _hideSecondaryProgress: function(secondaryRatio) {
95 return secondaryRatio === 0;