mirror of
https://github.com/chartjs/Chart.js.git
synced 2025-12-08 20:36:08 +00:00
Remove for of loops for IE compatibility (#6905)
This commit is contained in:
parent
e431554072
commit
c9fa553fb2
@ -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));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user