]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Reduce requestAnimationFrame polyfill (#7033)
authorBen McCann <322311+benmccann@users.noreply.github.com>
Fri, 31 Jan 2020 00:21:30 +0000 (16:21 -0800)
committerGitHub <noreply@github.com>
Fri, 31 Jan 2020 00:21:30 +0000 (19:21 -0500)
* Reduce requestAnimationFrame polyfill
* Remove another unnecessary polyfill

src/helpers/index.js

index 24eefc9068d5635e3d9393dbbd28e37d2e49f1bb..df5d4fbd0ce356ffe0ad77a471e97ec25465cf62 100644 (file)
@@ -101,21 +101,14 @@ export default {
 
                return niceFraction * Math.pow(10, exponent);
        },
-       // Request animation polyfill - https://www.paulirish.com/2011/requestanimationframe-for-smart-animating/
+       // Request animation polyfill
        requestAnimFrame: (function() {
                if (typeof window === 'undefined') {
                        return function(callback) {
                                callback();
                        };
                }
-               return window.requestAnimationFrame ||
-                       window.webkitRequestAnimationFrame ||
-                       window.mozRequestAnimationFrame ||
-                       window.oRequestAnimationFrame ||
-                       window.msRequestAnimationFrame ||
-                       function(callback) {
-                               return window.setTimeout(callback, 1000 / 60);
-                       };
+               return window.requestAnimationFrame;
        }()),
        // -- Canvas methods
        fontString: function(pixelSize, fontStyle, fontFamily) {