fix (ngAnimate): 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

Closes #6535
Closes #6540
This commit is contained in:
Thomas Belin
2014-03-04 17:22:02 +01:00
committed by Vojta Jina
parent aa4ba23350
commit ec16352579

View File

@@ -3,10 +3,12 @@
function $$RAFProvider(){ //rAF
this.$get = ['$window', '$timeout', function($window, $timeout) {
var requestAnimationFrame = $window.requestAnimationFrame ||
$window.webkitRequestAnimationFrame;
$window.webkitRequestAnimationFrame ||
$window.mozRequestAnimationFrame;
var cancelAnimationFrame = $window.cancelAnimationFrame ||
$window.webkitCancelAnimationFrame;
$window.webkitCancelAnimationFrame ||
$window.mozCancelAnimationFrame;
var rafSupported = !!requestAnimationFrame;
var raf = rafSupported