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

Commit

Permalink
fix(ngAnimate): remove event prepare class when skipping animation
Browse files Browse the repository at this point in the history
  • Loading branch information
swuttich committed Aug 30, 2018
1 parent a553735 commit 0761de2
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/ngAnimate/animation.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ var $$AnimationProvider = ['$animateProvider', /** @this */ function($animatePro
var element = animationEntry.from ? animationEntry.from.element : animationEntry.element;
var extraClasses = options.addClass;
extraClasses = (extraClasses ? (extraClasses + ' ') : '') + NG_ANIMATE_CLASSNAME;
var cacheKey = $$animateCache.cacheKey(node, event, extraClasses, options.removeClass);
var cacheKey = $$animateCache.cacheKey(node, animationEntry.event, extraClasses, options.removeClass);

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

function beforeStart() {
tempClasses = (tempClasses ? (tempClasses + ' ') : '') + NG_ANIMATE_CLASSNAME;
$$jqLite.addClass(element, tempClasses);

function removePrepareClass() {
var prepareClassName = element.data(PREPARE_CLASSES_KEY);
if (prepareClassName) {
$$jqLite.removeClass(element, prepareClassName);
prepareClassName = null;
}
}

function beforeStart() {
tempClasses = (tempClasses ? (tempClasses + ' ') : '') + NG_ANIMATE_CLASSNAME;
$$jqLite.addClass(element, tempClasses);

removePrepareClass();
}

function updateAnimationRunners(animation, newRunner) {
if (animation.from && animation.to) {
update(animation.from.element);
Expand Down

0 comments on commit 0761de2

Please sign in to comment.