@@ -215,8 +215,11 @@ angular.module('ngAnimate', ['ng'])
215
215
//the empty string value is the default animation
216
216
//operation which performs CSS transition and keyframe
217
217
//animations sniffing. This is always included for each
218
- //element animation procedure
219
- classes . push ( '' ) ;
218
+ //element animation procedure if the browser supports
219
+ //transitions and/or keyframe animations
220
+ if ( $sniffer . transitions || $sniffer . animations ) {
221
+ classes . push ( '' ) ;
222
+ }
220
223
221
224
for ( var i = 0 ; i < classes . length ; i ++ ) {
222
225
var klass = classes [ i ] ,
@@ -477,7 +480,7 @@ angular.module('ngAnimate', ['ng'])
477
480
478
481
//skip the animation if animations are disabled, a parent is already being animated
479
482
//or the element is not currently attached to the document body.
480
- if ( ( parent . inheritedData ( NG_ANIMATE_STATE ) || disabledAnimation ) . running ) {
483
+ if ( ( parent . inheritedData ( NG_ANIMATE_STATE ) || disabledAnimation ) . running || animations . length == 0 ) {
481
484
//avoid calling done() since there is no need to remove any
482
485
//data or className values since this happens earlier than that
483
486
//and also use a timeout so that it won't be asynchronous
@@ -579,11 +582,7 @@ angular.module('ngAnimate', ['ng'])
579
582
ELEMENT_NODE = 1 ;
580
583
581
584
function animate ( element , className , done ) {
582
- if ( ! ( $sniffer . transitions || $sniffer . animations ) ) {
583
- done ( ) ;
584
- return ;
585
- }
586
- else if ( [ 'ng-enter' , 'ng-leave' , 'ng-move' ] . indexOf ( className ) == - 1 ) {
585
+ if ( [ 'ng-enter' , 'ng-leave' , 'ng-move' ] . indexOf ( className ) == - 1 ) {
587
586
var existingDuration = 0 ;
588
587
forEach ( element , function ( element ) {
589
588
if ( element . nodeType == ELEMENT_NODE ) {
0 commit comments