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

Commit feb01ef

Browse files
committed
fix(ngAnimate): remove event prepare class when skipping animation
1 parent 2bbc7c4 commit feb01ef

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/ngAnimate/animation.js

+9-4
Original file line numberDiff line numberDiff line change
@@ -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)