-
Notifications
You must be signed in to change notification settings - Fork 13
/
fsm-actions.js
33 lines (28 loc) · 989 Bytes
/
fsm-actions.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import * as states from './fsm-states.js';
export default {
[states.START]: (_d, { $sideInner }) => {
$sideInner.style.position = 'absolute';
$sideInner.style.top = '0';
$sideInner.style.bottom = 'auto';
},
[states.TOP_FIXED]: (d, { $sideInner }) => {
$sideInner.style.position = 'fixed';
$sideInner.style.top = `${d.topSpacing}px`;
$sideInner.style.bottom = 'auto';
},
[states.UNFIXED]: (d, { $sideInner }) => {
$sideInner.style.position = 'absolute';
$sideInner.style.top = `${d.sideInnerTop - d.startPoint}px`;
$sideInner.style.bottom = 'auto';
},
[states.BOTTOM_FIXED]: (d, { $sideInner }) => {
$sideInner.style.position = 'fixed';
$sideInner.style.top = 'auto';
$sideInner.style.bottom = `${d.bottomSpacing}px`;
},
[states.FINISH]: (_d, { $sideInner }) => {
$sideInner.style.position = 'absolute';
$sideInner.style.top = 'auto';
$sideInner.style.bottom = '0';
}
}