@@ -97,8 +97,10 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {
97
97
98
98
this . $get = [ '$$rAF' , '$rootScope' , '$rootElement' , '$document' , '$$HashMap' ,
99
99
'$$animation' , '$$AnimateRunner' , '$templateRequest' , '$$jqLite' , '$$forceReflow' ,
100
+ '$$isDocumentHidden' ,
100
101
function ( $$rAF , $rootScope , $rootElement , $document , $$HashMap ,
101
- $$animation , $$AnimateRunner , $templateRequest , $$jqLite , $$forceReflow ) {
102
+ $$animation , $$AnimateRunner , $templateRequest , $$jqLite , $$forceReflow ,
103
+ $$isDocumentHidden ) {
102
104
103
105
var activeAnimationsLookup = new $$HashMap ( ) ;
104
106
var disabledElementsLookup = new $$HashMap ( ) ;
@@ -336,7 +338,7 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {
336
338
// past this point if not enabled
337
339
// Animations are also disabled if the document is currently hidden (page is not visible
338
340
// to the user), because browsers slow down or do not flush calls to requestAnimationFrame
339
- var skipAnimations = ! animationsEnabled || $document [ 0 ] . hidden || disabledElementsLookup . get ( node ) ;
341
+ var skipAnimations = ! animationsEnabled || $$isDocumentHidden ( ) || disabledElementsLookup . get ( node ) ;
340
342
var existingAnimation = ( ! skipAnimations && activeAnimationsLookup . get ( node ) ) || { } ;
341
343
var hasExistingAnimation = ! ! existingAnimation . state ;
342
344
0 commit comments