@@ -32,17 +32,8 @@ function performAnimation() {
32
32
navAnimationType = selectNavAnimationType ( ) ;
33
33
let code = 'promise1 = ' + encodeAnimFunctionName ( ) + '(infoChart);' ;
34
34
eval ( code ) ;
35
- if ( navAnimationType == 'switchToLineCount' ) {
36
- promise2 = nav_anim_01xx_10xx ( navChart , dirFilter . length ) ;
37
- }
38
- else if ( navAnimationType == 'switchToFileCount' ) {
39
- promise2 = nav_anim_10xx_01xx ( navChart , dirFilter . length ) ;
40
- }
41
- Promise . all ( [ promise1 , promise2 ] ) . then ( ( ) => {
42
- leaveTransientState ( ) ;
43
- if ( navAnimationType == 'switchToLineCount' )
44
- state_f_restore = false ;
45
- } ) ;
35
+ //paralellAnim(promise1);
36
+ serialAnim ( promise1 ) ;
46
37
updateAnimationVariables ( ) ;
47
38
}
48
39
@@ -201,3 +192,36 @@ function navLabelDrawHandler(event) {
201
192
event . data . rect . pos . y + event . data . rect . size . y - height / 2 ) ;
202
193
event . preventDefault ( ) ;
203
194
}
195
+
196
+ function paralellAnim ( promise1 ) {
197
+ let promise2 = Promise . resolve ( ) ;
198
+ if ( navAnimationType == 'switchToLineCount' ) {
199
+ promise2 = nav_anim_01xx_10xx ( navChart , dirFilter . length ) ;
200
+ }
201
+ else if ( navAnimationType == 'switchToFileCount' ) {
202
+ promise2 = nav_anim_10xx_01xx ( navChart , dirFilter . length ) ;
203
+ }
204
+ Promise . all ( [ promise1 , promise2 ] ) . then ( ( ) => {
205
+ leaveTransientState ( ) ;
206
+ if ( navAnimationType == 'switchToLineCount' )
207
+ state_f_restore = false ;
208
+ } ) ;
209
+ }
210
+
211
+ function serialAnim ( promise1 ) {
212
+ Promise . all ( [ promise1 ] ) . then ( ( ) => {
213
+ if ( navAnimationType == 'switchToLineCount' ) {
214
+ nav_anim_01xx_10xx ( navChart , dirFilter . length ) . then ( ( ) => {
215
+ leaveTransientState ( ) ;
216
+ state_f_restore = false ;
217
+ } ) ;
218
+ }
219
+ else if ( navAnimationType == 'switchToFileCount' ) {
220
+ nav_anim_10xx_01xx ( navChart , dirFilter . length ) . then ( ( ) => {
221
+ leaveTransientState ( ) ;
222
+ } ) ;
223
+ }
224
+ else
225
+ leaveTransientState ( ) ;
226
+ } ) ;
227
+ }
0 commit comments