Remove for of loops for IE compatibility (#6905)

This commit is contained in:
Jukka Kurkela 2020-01-04 19:59:27 +02:00 committed by Evert Timberg
parent e431554072
commit c9fa553fb2
2 changed files with 7 additions and 8 deletions

View File

@ -71,7 +71,7 @@ export default class Animations {
if (!isObject(cfg)) {
return;
}
for (let prop of cfg.properties || [key]) {
(cfg.properties || [key]).forEach(function(prop) {
// Can have only one config per animation.
if (!animatedProps.has(prop)) {
animatedProps.set(prop, extend({}, animDefaults, cfg));
@ -79,7 +79,7 @@ export default class Animations {
// Single property targetting config wins over multi-targetting.
animatedProps.set(prop, extend({}, animatedProps.get(prop), cfg));
}
}
});
});
}

View File

@ -64,12 +64,11 @@ class Animator {
_update() {
const me = this;
const date = Date.now();
const charts = me._charts;
let remaining = 0;
for (let [chart, anims] of charts) {
me._charts.forEach(function(anims, chart) {
if (!anims.running || !anims.items.length) {
continue;
return;
}
const items = anims.items;
let i = items.length - 1;
@ -105,12 +104,12 @@ class Animator {
}
remaining += items.length;
}
});
this._lastDate = date;
me._lastDate = date;
if (remaining === 0) {
this._running = false;
me._running = false;
}
}