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

Commit 9f55361

Browse files
committed
refactor(ngAnimate): simplify clearElementAnimationState() and remove redundant calls
1 parent a4d4d3c commit 9f55361

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/ngAnimate/animateQueue.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate
474474

475475
if (!isValidAnimation) {
476476
close();
477-
clearElementAnimationState(element);
477+
clearElementAnimationState(node);
478478
return runner;
479479
}
480480

@@ -523,7 +523,7 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate
523523
// isn't allowed to animate from here then we need to clear the state of the element
524524
// so that any future animations won't read the expired animation data.
525525
if (!isValidAnimation) {
526-
clearElementAnimationState(element);
526+
clearElementAnimationState(node);
527527
}
528528

529529
return;
@@ -547,7 +547,7 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate
547547
close(!status);
548548
var animationDetails = activeAnimationsLookup.get(node);
549549
if (animationDetails && animationDetails.counter === counter) {
550-
clearElementAnimationState(getDomNode(element));
550+
clearElementAnimationState(node);
551551
}
552552
notifyProgress(runner, event, 'close', {});
553553
});
@@ -603,8 +603,7 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate
603603
});
604604
}
605605

606-
function clearElementAnimationState(element) {
607-
var node = getDomNode(element);
606+
function clearElementAnimationState(node) {
608607
node.removeAttribute(NG_ANIMATE_ATTR_NAME);
609608
activeAnimationsLookup.remove(node);
610609
}

0 commit comments

Comments
 (0)