@@ -36,9 +36,9 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate
36
36
}
37
37
}
38
38
39
- function isAllowed ( ruleType , element , currentAnimation , previousAnimation ) {
39
+ function isAllowed ( ruleType , currentAnimation , previousAnimation ) {
40
40
return rules [ ruleType ] . some ( function ( fn ) {
41
- return fn ( element , currentAnimation , previousAnimation ) ;
41
+ return fn ( currentAnimation , previousAnimation ) ;
42
42
} ) ;
43
43
}
44
44
@@ -48,40 +48,40 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate
48
48
return and ? a && b : a || b ;
49
49
}
50
50
51
- rules . join . push ( function ( element , newAnimation , currentAnimation ) {
51
+ rules . join . push ( function ( newAnimation , currentAnimation ) {
52
52
// if the new animation is class-based then we can just tack that on
53
53
return ! newAnimation . structural && hasAnimationClasses ( newAnimation ) ;
54
54
} ) ;
55
55
56
- rules . skip . push ( function ( element , newAnimation , currentAnimation ) {
56
+ rules . skip . push ( function ( newAnimation , currentAnimation ) {
57
57
// there is no need to animate anything if no classes are being added and
58
58
// there is no structural animation that will be triggered
59
59
return ! newAnimation . structural && ! hasAnimationClasses ( newAnimation ) ;
60
60
} ) ;
61
61
62
- rules . skip . push ( function ( element , newAnimation , currentAnimation ) {
62
+ rules . skip . push ( function ( newAnimation , currentAnimation ) {
63
63
// why should we trigger a new structural animation if the element will
64
64
// be removed from the DOM anyway?
65
65
return currentAnimation . event === 'leave' && newAnimation . structural ;
66
66
} ) ;
67
67
68
- rules . skip . push ( function ( element , newAnimation , currentAnimation ) {
68
+ rules . skip . push ( function ( newAnimation , currentAnimation ) {
69
69
// if there is an ongoing current animation then don't even bother running the class-based animation
70
70
return currentAnimation . structural && currentAnimation . state === RUNNING_STATE && ! newAnimation . structural ;
71
71
} ) ;
72
72
73
- rules . cancel . push ( function ( element , newAnimation , currentAnimation ) {
73
+ rules . cancel . push ( function ( newAnimation , currentAnimation ) {
74
74
// there can never be two structural animations running at the same time
75
75
return currentAnimation . structural && newAnimation . structural ;
76
76
} ) ;
77
77
78
- rules . cancel . push ( function ( element , newAnimation , currentAnimation ) {
78
+ rules . cancel . push ( function ( newAnimation , currentAnimation ) {
79
79
// if the previous animation is already running, but the new animation will
80
80
// be triggered, but the new animation is structural
81
81
return currentAnimation . state === RUNNING_STATE && newAnimation . structural ;
82
82
} ) ;
83
83
84
- rules . cancel . push ( function ( element , newAnimation , currentAnimation ) {
84
+ rules . cancel . push ( function ( newAnimation , currentAnimation ) {
85
85
// cancel the animation if classes added / removed in both animation cancel each other out,
86
86
// but only if the current animation isn't structural
87
87
@@ -408,7 +408,7 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate
408
408
} ;
409
409
410
410
if ( hasExistingAnimation ) {
411
- var skipAnimationFlag = isAllowed ( 'skip' , element , newAnimation , existingAnimation ) ;
411
+ var skipAnimationFlag = isAllowed ( 'skip' , newAnimation , existingAnimation ) ;
412
412
if ( skipAnimationFlag ) {
413
413
if ( existingAnimation . state === RUNNING_STATE ) {
414
414
close ( ) ;
@@ -418,7 +418,7 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate
418
418
return existingAnimation . runner ;
419
419
}
420
420
}
421
- var cancelAnimationFlag = isAllowed ( 'cancel' , element , newAnimation , existingAnimation ) ;
421
+ var cancelAnimationFlag = isAllowed ( 'cancel' , newAnimation , existingAnimation ) ;
422
422
if ( cancelAnimationFlag ) {
423
423
if ( existingAnimation . state === RUNNING_STATE ) {
424
424
// this will end the animation right away and it is safe
@@ -440,7 +440,7 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate
440
440
// a joined animation means that this animation will take over the existing one
441
441
// so an example would involve a leave animation taking over an enter. Then when
442
442
// the postDigest kicks in the enter will be ignored.
443
- var joinAnimationFlag = isAllowed ( 'join' , element , newAnimation , existingAnimation ) ;
443
+ var joinAnimationFlag = isAllowed ( 'join' , newAnimation , existingAnimation ) ;
444
444
if ( joinAnimationFlag ) {
445
445
if ( existingAnimation . state === RUNNING_STATE ) {
446
446
normalizeAnimationDetails ( element , newAnimation ) ;
0 commit comments