launcher: display options descriptions for booleans too (use empty instead of false to let the placeholder appear)
This commit is contained in:
parent
8450904119
commit
654caea96e
2 changed files with 4 additions and 2 deletions
|
|
@ -5,6 +5,8 @@
|
|||
- bug fixes
|
||||
- `-g / --no-gui` didn't prevent the launcher from spanwing
|
||||
- `-e / --examples` not correctly parsed
|
||||
- main
|
||||
- launcher displays options descriptions for booleans too
|
||||
- widgets
|
||||
- added generic `value` option for setting a widget's initial value (does not sync linked widget nor send osc message)
|
||||
- **text** widget's `defaultText` replaced with `value`
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ $(document).ready(()=>{
|
|||
|
||||
if (option.type=='boolean') {
|
||||
|
||||
input = $(`<input name="${i}" class="checkbox" data-type="${option.type}" value="${value}"/>`)
|
||||
input = $(`<input name="${i}" class="checkbox" data-type="${option.type}" value="${value ? true : ''}" placeholder="${option.describe}"/>`)
|
||||
input.click(function(e){
|
||||
e.preventDefault()
|
||||
input.val(!eval(input.val())).trigger('change')
|
||||
|
|
@ -61,7 +61,7 @@ $(document).ready(()=>{
|
|||
input.on('change',function(e){
|
||||
var v = $(this).val()
|
||||
if (option.type == 'boolean') {
|
||||
v = v == 'true'
|
||||
v = v == 'true' ? true : ''
|
||||
input.val(v)
|
||||
} else if (v && option.type == 'array'){
|
||||
v = v.trim().split(' ')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue