@@ -473,13 +473,12 @@ angular.module('ngAnimate', ['ng'])
473
473
function isMatchingElement ( elm1 , elm2 ) {
474
474
return extractElementNode ( elm1 ) == extractElementNode ( elm2 ) ;
475
475
}
476
-
477
- var $coreAnimate ;
478
-
476
+ var $$jqLite ;
479
477
$provide . decorator ( '$animate' ,
480
- [ '$delegate' , '$$q' , '$injector' , '$sniffer' , '$rootElement' , '$$asyncCallback' , '$rootScope' , '$document' , '$templateRequest' ,
481
- function ( $delegate , $$q , $injector , $sniffer , $rootElement , $$asyncCallback , $rootScope , $document , $templateRequest ) {
482
- $coreAnimate = $delegate ;
478
+ [ '$delegate' , '$$q' , '$injector' , '$sniffer' , '$rootElement' , '$$asyncCallback' , '$rootScope' , '$document' , '$templateRequest' , '$$jqLite' ,
479
+ function ( $delegate , $$q , $injector , $sniffer , $rootElement , $$asyncCallback , $rootScope , $document , $templateRequest , $$$jqLite ) {
480
+
481
+ $$jqLite = $$$jqLite ;
483
482
$rootElement . data ( NG_ANIMATE_STATE , rootAnimateState ) ;
484
483
485
484
// Wait until all directive and route-related templates are downloaded and
@@ -1382,9 +1381,11 @@ angular.module('ngAnimate', ['ng'])
1382
1381
1383
1382
//the ng-animate class does nothing, but it's here to allow for
1384
1383
//parent animations to find and cancel child animations when needed
1385
- $delegate . $$addClassImmediately ( element , NG_ANIMATE_CLASS_NAME ) ;
1384
+ $$jqLite . addClass ( element , NG_ANIMATE_CLASS_NAME ) ;
1386
1385
if ( options && options . tempClasses ) {
1387
- $delegate . $$addClassImmediately ( element , options . tempClasses ) ;
1386
+ forEach ( options . tempClasses , function ( className ) {
1387
+ $$jqLite . addClass ( element , className ) ;
1388
+ } ) ;
1388
1389
}
1389
1390
1390
1391
var localAnimationCount = globalAnimationCounter ++ ;
@@ -1460,7 +1461,9 @@ angular.module('ngAnimate', ['ng'])
1460
1461
1461
1462
closeAnimation . hasBeenRun = true ;
1462
1463
if ( options && options . tempClasses ) {
1463
- $delegate . $$removeClassImmediately ( element , options . tempClasses ) ;
1464
+ forEach ( options . tempClasses , function ( className ) {
1465
+ $$jqLite . removeClass ( element , className ) ;
1466
+ } ) ;
1464
1467
}
1465
1468
1466
1469
var data = element . data ( NG_ANIMATE_STATE ) ;
@@ -1521,7 +1524,7 @@ angular.module('ngAnimate', ['ng'])
1521
1524
}
1522
1525
1523
1526
if ( removeAnimations || ! data . totalActive ) {
1524
- $delegate . $$removeClassImmediately ( element , NG_ANIMATE_CLASS_NAME ) ;
1527
+ $$jqLite . removeClass ( element , NG_ANIMATE_CLASS_NAME ) ;
1525
1528
element . removeData ( NG_ANIMATE_STATE ) ;
1526
1529
}
1527
1530
}
@@ -1762,22 +1765,22 @@ angular.module('ngAnimate', ['ng'])
1762
1765
var staggerCacheKey = cacheKey + ' ' + staggerClassName ;
1763
1766
var applyClasses = ! lookupCache [ staggerCacheKey ] ;
1764
1767
1765
- applyClasses && $coreAnimate . $$addClassImmediately ( element , staggerClassName ) ;
1768
+ applyClasses && $$jqLite . addClass ( element , staggerClassName ) ;
1766
1769
1767
1770
stagger = getElementAnimationDetails ( element , staggerCacheKey ) ;
1768
1771
1769
- applyClasses && $coreAnimate . $$removeClassImmediately ( element , staggerClassName ) ;
1772
+ applyClasses && $$jqLite . removeClass ( element , staggerClassName ) ;
1770
1773
}
1771
1774
1772
- $coreAnimate . $$addClassImmediately ( element , className ) ;
1775
+ $$jqLite . addClass ( element , className ) ;
1773
1776
1774
1777
var formerData = element . data ( NG_ANIMATE_CSS_DATA_KEY ) || { } ;
1775
1778
var timings = getElementAnimationDetails ( element , eventCacheKey ) ;
1776
1779
var transitionDuration = timings . transitionDuration ;
1777
1780
var animationDuration = timings . animationDuration ;
1778
1781
1779
1782
if ( structural && transitionDuration === 0 && animationDuration === 0 ) {
1780
- $coreAnimate . $$removeClassImmediately ( element , className ) ;
1783
+ $$jqLite . removeClass ( element , className ) ;
1781
1784
return false ;
1782
1785
}
1783
1786
@@ -1849,7 +1852,7 @@ angular.module('ngAnimate', ['ng'])
1849
1852
}
1850
1853
1851
1854
if ( ! staggerTime ) {
1852
- $coreAnimate . $$addClassImmediately ( element , activeClassName ) ;
1855
+ $$jqLite . addClass ( element , activeClassName ) ;
1853
1856
if ( elementData . blockTransition ) {
1854
1857
blockTransitions ( node , false ) ;
1855
1858
}
@@ -1859,7 +1862,7 @@ angular.module('ngAnimate', ['ng'])
1859
1862
var timings = getElementAnimationDetails ( element , eventCacheKey ) ;
1860
1863
var maxDuration = Math . max ( timings . transitionDuration , timings . animationDuration ) ;
1861
1864
if ( maxDuration === 0 ) {
1862
- $coreAnimate . $$removeClassImmediately ( element , activeClassName ) ;
1865
+ $$jqLite . removeClass ( element , activeClassName ) ;
1863
1866
animateClose ( element , className ) ;
1864
1867
activeAnimationComplete ( ) ;
1865
1868
return ;
@@ -1894,7 +1897,7 @@ angular.module('ngAnimate', ['ng'])
1894
1897
1895
1898
var staggerTimeout ;
1896
1899
if ( staggerTime > 0 ) {
1897
- $coreAnimate . $$addClassImmediately ( element , pendingClassName ) ;
1900
+ $$jqLite . addClass ( element , pendingClassName ) ;
1898
1901
staggerTimeout = $timeout ( function ( ) {
1899
1902
staggerTimeout = null ;
1900
1903
@@ -1905,8 +1908,8 @@ angular.module('ngAnimate', ['ng'])
1905
1908
blockAnimations ( node , false ) ;
1906
1909
}
1907
1910
1908
- $coreAnimate . $$addClassImmediately ( element , activeClassName ) ;
1909
- $coreAnimate . $$removeClassImmediately ( element , pendingClassName ) ;
1911
+ $$jqLite . addClass ( element , activeClassName ) ;
1912
+ $$jqLite . removeClass ( element , pendingClassName ) ;
1910
1913
1911
1914
if ( styles ) {
1912
1915
if ( timings . transitionDuration === 0 ) {
@@ -1933,8 +1936,8 @@ angular.module('ngAnimate', ['ng'])
1933
1936
// timeout done method.
1934
1937
function onEnd ( ) {
1935
1938
element . off ( css3AnimationEvents , onAnimationProgress ) ;
1936
- $coreAnimate . $$removeClassImmediately ( element , activeClassName ) ;
1937
- $coreAnimate . $$removeClassImmediately ( element , pendingClassName ) ;
1939
+ $$jqLite . removeClass ( element , activeClassName ) ;
1940
+ $$jqLite . removeClass ( element , pendingClassName ) ;
1938
1941
if ( staggerTimeout ) {
1939
1942
$timeout . cancel ( staggerTimeout ) ;
1940
1943
}
@@ -2022,7 +2025,7 @@ angular.module('ngAnimate', ['ng'])
2022
2025
}
2023
2026
2024
2027
function animateClose ( element , className ) {
2025
- $coreAnimate . $$removeClassImmediately ( element , className ) ;
2028
+ $$jqLite . removeClass ( element , className ) ;
2026
2029
var data = element . data ( NG_ANIMATE_CSS_DATA_KEY ) ;
2027
2030
if ( data ) {
2028
2031
if ( data . running ) {
0 commit comments