Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 0761de2

Browse files
committed
fix(ngAnimate): remove event prepare class when skipping animation
1 parent a553735 commit 0761de2

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/ngAnimate/animation.js

+10-5
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ var $$AnimationProvider = ['$animateProvider', /** @this */ function($animatePro
187187
var element = animationEntry.from ? animationEntry.from.element : animationEntry.element;
188188
var extraClasses = options.addClass;
189189
extraClasses = (extraClasses ? (extraClasses + ' ') : '') + NG_ANIMATE_CLASSNAME;
190-
var cacheKey = $$animateCache.cacheKey(node, event, extraClasses, options.removeClass);
190+
var cacheKey = $$animateCache.cacheKey(node, animationEntry.event, extraClasses, options.removeClass);
191191

192192
toBeSortedAnimations.push({
193193
element: element,
@@ -199,6 +199,7 @@ var $$AnimationProvider = ['$animateProvider', /** @this */ function($animatePro
199199
// and it's in fact an invalid animation (something that has duration = 0)
200200
// then we should skip all the heavy work from here on
201201
if ($$animateCache.containsCachedAnimationWithoutDuration(cacheKey)) {
202+
removePrepareClass();
202203
closeFn();
203204
return;
204205
}
@@ -399,17 +400,21 @@ var $$AnimationProvider = ['$animateProvider', /** @this */ function($animatePro
399400
}
400401
}
401402

402-
function beforeStart() {
403-
tempClasses = (tempClasses ? (tempClasses + ' ') : '') + NG_ANIMATE_CLASSNAME;
404-
$$jqLite.addClass(element, tempClasses);
405-
403+
function removePrepareClass() {
406404
var prepareClassName = element.data(PREPARE_CLASSES_KEY);
407405
if (prepareClassName) {
408406
$$jqLite.removeClass(element, prepareClassName);
409407
prepareClassName = null;
410408
}
411409
}
412410

411+
function beforeStart() {
412+
tempClasses = (tempClasses ? (tempClasses + ' ') : '') + NG_ANIMATE_CLASSNAME;
413+
$$jqLite.addClass(element, tempClasses);
414+
415+
removePrepareClass();
416+
}
417+
413418
function updateAnimationRunners(animation, newRunner) {
414419
if (animation.from && animation.to) {
415420
update(animation.from.element);

0 commit comments

Comments
 (0)