Skip to content

Commit 42de3e7

Browse files
author
Thomas Belin
committed
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 angular#6535
1 parent d07101d commit 42de3e7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/ng/raf.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
function $$RAFProvider(){ //rAF
44
this.$get = ['$window', function($window) {
55
var requestAnimationFrame = $window.requestAnimationFrame ||
6-
$window.webkitRequestAnimationFrame;
6+
$window.webkitRequestAnimationFrame ||
7+
$window.mozRequestAnimationFrame;
78

89
var cancelAnimationFrame = $window.cancelAnimationFrame ||
9-
$window.webkitCancelAnimationFrame;
10+
$window.webkitCancelAnimationFrame ||
11+
$window.mozCancelAnimationFrame;
1012

1113
var raf = function(fn) {
1214
var id = requestAnimationFrame(fn);

0 commit comments

Comments
 (0)