pads: clean address splitting api
This commit is contained in:
parent
999febcb99
commit
1d01b47efb
4 changed files with 8 additions and 8 deletions
|
|
@ -52,7 +52,7 @@ module.exports = class MultiXy extends _pads_base {
|
|||
this.widget[0].style.setProperty("--point-size",this.pointSize + 'rem')
|
||||
|
||||
this.split = widgetData.split?
|
||||
typeof widgetData.split == 'object'?
|
||||
typeof widgetData.split == 'object' && widgetData.split.length == 2 * widgetData.points ?
|
||||
widgetData.split
|
||||
: (()=>{
|
||||
var s={};
|
||||
|
|
|
|||
|
|
@ -42,9 +42,9 @@ module.exports = class Rgb extends _pads_base {
|
|||
super(...arguments)
|
||||
|
||||
this.split = widgetData.split?
|
||||
typeof widgetData.split == 'object'?
|
||||
typeof widgetData.split == 'object' && widgetData.split.length == 3 ?
|
||||
widgetData.split
|
||||
: {r: widgetData.address + '/r', g: widgetData.address + '/g', b: widgetData.address + '/b'}
|
||||
: [widgetData.address + '/r', widgetData.address + '/g', widgetData.address + '/b']
|
||||
: false
|
||||
|
||||
this.widget.append(`
|
||||
|
|
|
|||
|
|
@ -47,9 +47,9 @@ module.exports = class Xy extends _pads_base {
|
|||
super(...arguments)
|
||||
|
||||
this.split = widgetData.split?
|
||||
typeof widgetData.split == 'object'?
|
||||
typeof widgetData.split == 'object' && widgetData.split.length == 2 ?
|
||||
widgetData.split
|
||||
: {x: widgetData.address + '/x', y: widgetData.address + '/y'}
|
||||
: [widgetData.address + '/x', widgetData.address + '/y']
|
||||
: false
|
||||
|
||||
this.widget.append(`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue