perf(range): generates inefficient JS

This commit is contained in:
Manu Mtz.-Almeida
2016-11-28 01:40:51 +01:00
parent 6b3e2ed447
commit d2ebac3d27

View File

@ -579,17 +579,18 @@ export class Range extends Ion implements AfterViewInit, ControlValueAccessor, O
* @private
*/
updateTicks() {
if (this._snaps && this._ticks) {
let ratio = this.ratio;
const ticks = this._ticks;
if (this._snaps && ticks) {
var ratio = this.ratio;
if (this._dual) {
let upperRatio = this.ratioUpper;
var upperRatio = this.ratioUpper;
this._ticks.forEach(t => {
ticks.forEach(t => {
t.active = (t.ratio >= ratio && t.ratio <= upperRatio);
});
} else {
this._ticks.forEach(t => {
ticks.forEach(t => {
t.active = (t.ratio <= ratio);
});
}