From 42de3e7ed28880f9fc89654419a2df21a2e9f2a9 Mon Sep 17 00:00:00 2001 From: Thomas Belin Date: Tue, 4 Mar 2014 17:22:02 +0100 Subject: [PATCH] fix (ngAnimate $rAF): fix requestAnimationFrame for old version of Firefox The recent $$RAFProvider which is a wrapper for the native requestAnimationFrame method doesn't use the mozRequestAnimationFrame. Old versions of FF (20 for example) crash if ngAnimate is included No breaking changes and fix issue https://github.com/angular/angular.js/issues/6535 --- src/ng/raf.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ng/raf.js b/src/ng/raf.js index f85ee12a4223..f4eb31c0bf7e 100644 --- a/src/ng/raf.js +++ b/src/ng/raf.js @@ -3,10 +3,12 @@ function $$RAFProvider(){ //rAF this.$get = ['$window', function($window) { var requestAnimationFrame = $window.requestAnimationFrame || - $window.webkitRequestAnimationFrame; + $window.webkitRequestAnimationFrame || + $window.mozRequestAnimationFrame; var cancelAnimationFrame = $window.cancelAnimationFrame || - $window.webkitCancelAnimationFrame; + $window.webkitCancelAnimationFrame || + $window.mozCancelAnimationFrame; var raf = function(fn) { var id = requestAnimationFrame(fn);