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

Commit 3db2092

Browse files
committed
refactor(ngAnimate): remove unused argument
1 parent d03cac4 commit 3db2092

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/ngAnimate/animateQueue.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate
3636
}
3737
}
3838

39-
function isAllowed(ruleType, element, currentAnimation, previousAnimation) {
39+
function isAllowed(ruleType, currentAnimation, previousAnimation) {
4040
return rules[ruleType].some(function(fn) {
41-
return fn(element, currentAnimation, previousAnimation);
41+
return fn(currentAnimation, previousAnimation);
4242
});
4343
}
4444

@@ -48,40 +48,40 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate
4848
return and ? a && b : a || b;
4949
}
5050

51-
rules.join.push(function(element, newAnimation, currentAnimation) {
51+
rules.join.push(function(newAnimation, currentAnimation) {
5252
// if the new animation is class-based then we can just tack that on
5353
return !newAnimation.structural && hasAnimationClasses(newAnimation);
5454
});
5555

56-
rules.skip.push(function(element, newAnimation, currentAnimation) {
56+
rules.skip.push(function(newAnimation, currentAnimation) {
5757
// there is no need to animate anything if no classes are being added and
5858
// there is no structural animation that will be triggered
5959
return !newAnimation.structural && !hasAnimationClasses(newAnimation);
6060
});
6161

62-
rules.skip.push(function(element, newAnimation, currentAnimation) {
62+
rules.skip.push(function(newAnimation, currentAnimation) {
6363
// why should we trigger a new structural animation if the element will
6464
// be removed from the DOM anyway?
6565
return currentAnimation.event === 'leave' && newAnimation.structural;
6666
});
6767

68-
rules.skip.push(function(element, newAnimation, currentAnimation) {
68+
rules.skip.push(function(newAnimation, currentAnimation) {
6969
// if there is an ongoing current animation then don't even bother running the class-based animation
7070
return currentAnimation.structural && currentAnimation.state === RUNNING_STATE && !newAnimation.structural;
7171
});
7272

73-
rules.cancel.push(function(element, newAnimation, currentAnimation) {
73+
rules.cancel.push(function(newAnimation, currentAnimation) {
7474
// there can never be two structural animations running at the same time
7575
return currentAnimation.structural && newAnimation.structural;
7676
});
7777

78-
rules.cancel.push(function(element, newAnimation, currentAnimation) {
78+
rules.cancel.push(function(newAnimation, currentAnimation) {
7979
// if the previous animation is already running, but the new animation will
8080
// be triggered, but the new animation is structural
8181
return currentAnimation.state === RUNNING_STATE && newAnimation.structural;
8282
});
8383

84-
rules.cancel.push(function(element, newAnimation, currentAnimation) {
84+
rules.cancel.push(function(newAnimation, currentAnimation) {
8585
// cancel the animation if classes added / removed in both animation cancel each other out,
8686
// but only if the current animation isn't structural
8787

@@ -408,7 +408,7 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate
408408
};
409409

410410
if (hasExistingAnimation) {
411-
var skipAnimationFlag = isAllowed('skip', element, newAnimation, existingAnimation);
411+
var skipAnimationFlag = isAllowed('skip', newAnimation, existingAnimation);
412412
if (skipAnimationFlag) {
413413
if (existingAnimation.state === RUNNING_STATE) {
414414
close();
@@ -418,7 +418,7 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate
418418
return existingAnimation.runner;
419419
}
420420
}
421-
var cancelAnimationFlag = isAllowed('cancel', element, newAnimation, existingAnimation);
421+
var cancelAnimationFlag = isAllowed('cancel', newAnimation, existingAnimation);
422422
if (cancelAnimationFlag) {
423423
if (existingAnimation.state === RUNNING_STATE) {
424424
// this will end the animation right away and it is safe
@@ -440,7 +440,7 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate
440440
// a joined animation means that this animation will take over the existing one
441441
// so an example would involve a leave animation taking over an enter. Then when
442442
// the postDigest kicks in the enter will be ignored.
443-
var joinAnimationFlag = isAllowed('join', element, newAnimation, existingAnimation);
443+
var joinAnimationFlag = isAllowed('join', newAnimation, existingAnimation);
444444
if (joinAnimationFlag) {
445445
if (existingAnimation.state === RUNNING_STATE) {
446446
normalizeAnimationDetails(element, newAnimation);

0 commit comments

Comments
 (0)