githiro / drawDoughnutChart

A SVG doughnut chart with animation and tooltip.
http://codepen.io/githiro/details/ICfFE
88 stars 40 forks source link

'arguments.callee' creates problem with "strict" mode . #8

Open srivig opened 9 years ago

srivig commented 9 years ago

arguments.callee was removed from ES5 strict mode

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments/callee

donotfold commented 7 years ago

This fixes it:

find and replace the 'animationLoop' function with this:

function animationLoop(drawData) { var animFrameAmount = (settings.animation)? 1 / CapValue(settings.animationSteps, Number.MAX_VALUE, 1) : 1, cnt =(settings.animation)? 0 : 1; requestAnimFrame(function cb() { cnt += animFrameAmount; animateFrame(cnt, drawData); if (cnt <= 1) { requestAnimFrame(cb); } else { settings.afterDrawed.call($this); } }); }