@@ -66,10 +66,10 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {
66
66
return ( nO . addClass && nO . addClass === cO . removeClass ) || ( nO . removeClass && nO . removeClass === cO . addClass ) ;
67
67
} ) ;
68
68
69
- this . $get = [ '$$rAF' , '$rootScope' , '$rootElement' , '$document' , '$$body ' , '$$HashMap ' ,
70
- '$$animation' , '$$ AnimateRunner', '$templateRequest' , '$$jqLite' , '$$forceReflow' ,
71
- function ( $$rAF , $rootScope , $rootElement , $document , $$body , $$HashMap ,
72
- $$animation , $$ AnimateRunner, $templateRequest , $$jqLite , $$forceReflow ) {
69
+ this . $get = [ '$$rAF' , '$rootScope' , '$rootElement' , '$document' , '$$HashMap ' , '$$animation ' ,
70
+ '$$AnimateRunner' , '$templateRequest' , '$$jqLite' , '$$forceReflow' ,
71
+ function ( $$rAF , $rootScope , $rootElement , $document , $$HashMap , $$animation ,
72
+ $$AnimateRunner , $templateRequest , $$jqLite , $$forceReflow ) {
73
73
74
74
var activeAnimationsLookup = new $$HashMap ( ) ;
75
75
var disabledElementsLookup = new $$HashMap ( ) ;
@@ -501,8 +501,17 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {
501
501
return getDomNode ( nodeOrElmA ) === getDomNode ( nodeOrElmB ) ;
502
502
}
503
503
504
+ function isBodyElement ( node , $document ) {
505
+ // if a ng-if is placed on the <body> tag then we
506
+ // may end up with a new body element entirely so it's
507
+ // best to just compare the body directly to the body
508
+ // node present within the document node.
509
+ return $document [ 0 ] . body === node ;
510
+ }
511
+
504
512
function areAnimationsAllowed ( element , parentElement , event ) {
505
- var bodyElementDetected = isMatchingElement ( element , $$body ) || element [ 0 ] . nodeName === 'HTML' ;
513
+ var node = getDomNode ( element ) ;
514
+ var bodyElementDetected = isBodyElement ( node , $document ) || node . nodeName === 'HTML' ;
506
515
var rootElementDetected = isMatchingElement ( element , $rootElement ) ;
507
516
var parentAnimationDetected = false ;
508
517
var animateChildren ;
@@ -558,7 +567,7 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {
558
567
if ( ! bodyElementDetected ) {
559
568
// we also need to ensure that the element is or will be apart of the body element
560
569
// otherwise it is pointless to even issue an animation to be rendered
561
- bodyElementDetected = isMatchingElement ( parentElement , $$body ) ;
570
+ bodyElementDetected = isBodyElement ( parentNode , $document ) ;
562
571
}
563
572
564
573
parentElement = parentElement . parent ( ) ;
0 commit comments