From bc492c0fc17257ddf2bc5964e205379aa766b3d8 Mon Sep 17 00:00:00 2001 From: Matias Niemelä Date: Thu, 2 Jan 2014 12:01:46 -0500 Subject: fix($animate): ensure class-based animations are always skipped before structural post-digest tasks are run Closes #5582 --- src/ngAnimate/animate.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/ngAnimate') diff --git a/src/ngAnimate/animate.js b/src/ngAnimate/animate.js index 5f8dc673..64ed3029 100644 --- a/src/ngAnimate/animate.js +++ b/src/ngAnimate/animate.js @@ -610,9 +610,14 @@ angular.module('ngAnimate', ['ng']) } var animations = []; + //only add animations if the currently running animation is not structural //or if there is no animation running at all - if(!ngAnimateState.running || !(isClassBased && ngAnimateState.structural)) { + var allowAnimations = isClassBased ? + !ngAnimateState.disabled && (!ngAnimateState.running || !ngAnimateState.structural) : + true; + + if(allowAnimations) { forEach(matches, function(animation) { //add the animation to the queue to if it is allowed to be cancelled if(!animation.allowCancel || animation.allowCancel(element, animationEvent, className)) { -- cgit v1.2.3