diff options
| author | bozo.kopic <bozo@kopic.xyz> | 2021-12-19 03:28:00 +0100 |
|---|---|---|
| committer | bozo.kopic <bozo@kopic.xyz> | 2021-12-19 03:28:00 +0100 |
| commit | f2a664ee509cc0a5840da0ed932bfc3eadea9a74 (patch) | |
| tree | e9cae8b30f78578bbe29103b7fffb0331069ec2c /src_js/vt.js | |
| parent | b7883de47e05d0b52ea4e04440f4894a0a9032a1 (diff) | |
additional calculate parameter - minimize initial panel usage
Diffstat (limited to 'src_js/vt.js')
| -rw-r--r-- | src_js/vt.js | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src_js/vt.js b/src_js/vt.js index 8320f75..ce16d3d 100644 --- a/src_js/vt.js +++ b/src_js/vt.js @@ -68,7 +68,11 @@ function leftPanel() { ['label', 'Cut width'], numberInput(r.get('form', 'cut_width'), u.isNumber, - val => r.set(['form', 'cut_width'], val)) + val => r.set(['form', 'cut_width'], val)), + ['label'], + checkboxInput('Minimize initial panel usage', + r.get('form', 'min_initial_usage'), + val => r.set(['form', 'min_initial_usage'], val)) ], ['div.content', leftPanelPanels(), @@ -240,7 +244,8 @@ function leftPanelItems() { ], ['td.col-rotate', ['div', - checkboxInput(item.can_rotate, + checkboxInput(null, + item.can_rotate, val => r.set([itemsPath, index, 'can_rotate'], val)) ] ], @@ -473,8 +478,8 @@ function numberInput(value, validator, onChange) { } -function checkboxInput(value, onChange) { - return ['input', { +function checkboxInput(label, value, onChange) { + const input = ['input', { props: { type: 'checkbox', checked: value @@ -483,6 +488,14 @@ function checkboxInput(value, onChange) { change: evt => onChange(evt.target.checked) } }]; + + if (!label) + return input; + + return ['label', + input, + ` ${label}` + ]; } |
