@@ -23,37 +23,35 @@ function animatedPanelContainer(
2323 }
2424
2525 var isAnimatingForwards = true ;
26- var animateOut = false ;
26+ var isAnimatingOut = false ;
2727 var leavingPanel = null ;
2828 var activelyAnimatingTimeout = false ;
29- var activelyAnimating = false ;
29+ var isActivelyAnimating = false ;
3030
3131 var panels = [ ] ;
3232 var panelElements = { } ;
3333 $scope . activePanel = null ;
3434
3535 $scope . goToPanel = function ( panelName , style ) {
3636 if ( panels . includes ( panelName ) ) {
37- activelyAnimating = true ;
38- $timeout ( function ( ) {
39- isAnimatingForwards = style !== 'back' ;
40- animateOut = false ;
41- leavingPanel = $scope . activePanel ;
37+ isActivelyAnimating = style !== 'immediate' ;
38+ isAnimatingForwards = style !== 'back' ;
39+ isAnimatingOut = false ;
40+ leavingPanel = $scope . activePanel ;
4241
43- // Quick move our elements to the right spot, then let them animate into place
44- $timeout ( function ( ) {
45- if ( style !== 'immediate' ) {
46- animateOut = true ;
47- $timeout . cancel ( activelyAnimatingTimeout ) ;
48- activelyAnimatingTimeout = $timeout ( function ( ) {
49- activelyAnimating = false ;
50- } , 300 ) ;
51- }
52- $scope . activePanel = panelName ;
53- } , 0 ) ;
42+ // Quick move our elements to the right spot, then let them animate into place
43+ $timeout ( function ( ) {
44+ if ( style !== 'immediate' ) {
45+ isAnimatingOut = true ;
46+ $timeout . cancel ( activelyAnimatingTimeout ) ;
47+ activelyAnimatingTimeout = $timeout ( function ( ) {
48+ isActivelyAnimating = false ;
49+ } , 300 ) ;
50+ }
51+ $scope . activePanel = panelName ;
5452 } , 0 ) ;
5553 } else {
56- activelyAnimating = false ;
54+ isActivelyAnimating = false ;
5755 console . error ( 'Tried going to panel that doesn\'t exist' , panelName ) ;
5856 }
5957 } ;
@@ -72,7 +70,7 @@ function animatedPanelContainer(
7270
7371 $scope . getAnimatedPanelStyle = function ( ) {
7472 var inElement = panelElements [ $scope . activePanel ] ;
75- if ( ! inElement || ! activelyAnimating ) {
73+ if ( ! inElement || ! isActivelyAnimating ) {
7674 return ;
7775 }
7876 return {
@@ -91,8 +89,8 @@ function animatedPanelContainer(
9189 out : panelName !== $scope . activePanel ,
9290 in : panelName === $scope . activePanel ,
9391 back : ! goingForwards ,
94- animated : animateOut ,
95- animating : activelyAnimating
92+ animated : isAnimatingOut ,
93+ animating : isActivelyAnimating
9694 } ;
9795 } ;
9896
0 commit comments