switchers: remove default value for "value" option, fix crossfader not including its fader value in its initial state
This commit is contained in:
parent
1a25293c78
commit
ea55e99662
3 changed files with 7 additions and 7 deletions
|
|
@ -87,11 +87,9 @@ module.exports = class _switchers_base extends _widgets_base {
|
|||
for (var id in state) {
|
||||
var value = state[id],
|
||||
widgets = widgetManager.getWidgetById(id)
|
||||
if (widgets.length) {
|
||||
for (var i=widgets.length-1;i>=0;i--) {
|
||||
if (widgets[i].setValue) {
|
||||
widgets[i].setValue(value,{sync:options.sync, send:options.send})
|
||||
}
|
||||
for (var i = widgets.length - 1; i >= 0; i--) {
|
||||
if (widgets[i].setValue) {
|
||||
widgets[i].setValue(value,{sync:options.sync, send:options.send})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,6 +41,8 @@ module.exports = class Crossfader extends Switcher {
|
|||
|
||||
})
|
||||
|
||||
this.value._fader = 0
|
||||
|
||||
}
|
||||
|
||||
setValue(v, options={}) {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ module.exports = class Switcher extends _switchers_base {
|
|||
horizontal:false,
|
||||
linkedWidgets:'',
|
||||
values:['A', 'B'],
|
||||
value:'A',
|
||||
value:'',
|
||||
|
||||
_osc:'osc',
|
||||
|
||||
|
|
@ -73,7 +73,7 @@ module.exports = class Switcher extends _switchers_base {
|
|||
|
||||
setValue(v, options={}) {
|
||||
|
||||
super.setValue(...arguments)
|
||||
super.setValue(v, options)
|
||||
|
||||
if (!options.fromSelf) this.switch.setValue(this.value._selected)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue