Skip to content

Commit ca2df5d

Browse files
committed
serial and paralell animation is selectable
1 parent 0a3019c commit ca2df5d

File tree

1 file changed

+35
-11
lines changed

1 file changed

+35
-11
lines changed

media/scripts/uiLogic-animations.js

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,8 @@ function performAnimation() {
3232
navAnimationType = selectNavAnimationType();
3333
let code = 'promise1 = ' + encodeAnimFunctionName() + '(infoChart);';
3434
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);
4637
updateAnimationVariables();
4738
}
4839

@@ -201,3 +192,36 @@ function navLabelDrawHandler(event) {
201192
event.data.rect.pos.y + event.data.rect.size.y - height / 2);
202193
event.preventDefault();
203194
}
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

Comments
 (0)