matrices: fix children target/precision/preArgs update
This commit is contained in:
parent
523d12c4e1
commit
74810c9c26
5 changed files with 33 additions and 4 deletions
|
|
@ -5,6 +5,7 @@
|
|||
- bug fixes
|
||||
- meter's properties not accessible (overridden with fader's properties)
|
||||
- `--read-only` option not properly working
|
||||
- `keyboard`: dynamic properties `target`, `precision` & `preArgs` not being updated dynamically
|
||||
- widgets
|
||||
- formulas: added `indexOf` function
|
||||
- **deprecated** `multifader` / `multipush` / `multitoggle` in favor of the generic `matrix` widget
|
||||
|
|
|
|||
|
|
@ -67,9 +67,16 @@ module.exports = class Keyboard extends _matrix_base {
|
|||
data.label = false
|
||||
data.css = ''
|
||||
|
||||
data.target = '@{parent.target}'
|
||||
data.precision = '@{parent.precision}'
|
||||
|
||||
if (!this.getProp('split')) {
|
||||
data.address = '@{parent.address}'
|
||||
data.preArgs = '#{concat(@{parent.preArgs},[' + i + '])}'
|
||||
data.preArgs = `#{
|
||||
a = @{parent.preArgs};
|
||||
b = typeof(a) == 'string' and a == '' ? [] : typeof(a) == 'Array' ? a : [a];
|
||||
concat(b, [${i}])
|
||||
}`
|
||||
} else if (typeof this.getProp('split') === 'string' && this.getProp('split')[0] === '/' && /[^\\]\$/.test(this.getProp('split'))) {
|
||||
data.address = this.getProp('split').replace(/([^\\])(\$)/g,'$1' + i).replace(/\\\$/g, '$')
|
||||
data.preArgs = '@{parent.preArgs}'
|
||||
|
|
|
|||
|
|
@ -76,9 +76,16 @@ module.exports = class Multifader extends _matrix_base {
|
|||
data.label = i
|
||||
data.css = ''
|
||||
|
||||
data.target = '@{parent.target}'
|
||||
data.precision = '@{parent.precision}'
|
||||
|
||||
if (!this.getProp('split')) {
|
||||
data.address = '@{parent.address}'
|
||||
data.preArgs = '#{concat(@{parent.preArgs},[' + i + '])}'
|
||||
data.preArgs = `#{
|
||||
a = @{parent.preArgs};
|
||||
b = typeof(a) == 'string' and a == '' ? [] : typeof(a) == 'Array' ? a : [a];
|
||||
concat(b, [${i}])
|
||||
}`
|
||||
} else if (typeof this.getProp('split') === 'string' && this.getProp('split')[0] === '/' && /[^\\]\$/.test(this.getProp('split'))) {
|
||||
data.address = this.getProp('split').replace(/([^\\])(\$)/g,'$1' + i).replace(/\\\$/g, '$')
|
||||
data.preArgs = '@{parent.preArgs}'
|
||||
|
|
|
|||
|
|
@ -67,9 +67,16 @@ module.exports = class Multipush extends _matrix_base {
|
|||
data.label = i
|
||||
data.css = ''
|
||||
|
||||
data.target = '@{parent.target}'
|
||||
data.precision = '@{parent.precision}'
|
||||
|
||||
if (!this.getProp('split')) {
|
||||
data.address = '@{parent.address}'
|
||||
data.preArgs = '#{concat(@{parent.preArgs},[' + i + '])}'
|
||||
data.preArgs = `#{
|
||||
a = @{parent.preArgs};
|
||||
b = typeof(a) == 'string' and a == '' ? [] : typeof(a) == 'Array' ? a : [a];
|
||||
concat(b, [${i}])
|
||||
}`
|
||||
} else if (typeof this.getProp('split') === 'string' && this.getProp('split')[0] === '/' && /[^\\]\$/.test(this.getProp('split'))) {
|
||||
data.address = this.getProp('split').replace(/([^\\])(\$)/g,'$1' + i).replace(/\\\$/g, '$')
|
||||
data.preArgs = '@{parent.preArgs}'
|
||||
|
|
|
|||
|
|
@ -67,9 +67,16 @@ module.exports = class Multitoggle extends _matrix_base {
|
|||
data.label = i
|
||||
data.css = ''
|
||||
|
||||
data.target = '@{parent.target}'
|
||||
data.precision = '@{parent.precision}'
|
||||
|
||||
if (!this.getProp('split')) {
|
||||
data.address = '@{parent.address}'
|
||||
data.preArgs = '#{concat(@{parent.preArgs},[' + i + '])}'
|
||||
data.preArgs = `#{
|
||||
a = @{parent.preArgs};
|
||||
b = typeof(a) == 'string' and a == '' ? [] : typeof(a) == 'Array' ? a : [a];
|
||||
concat(b, [${i}])
|
||||
}`
|
||||
} else if (typeof this.getProp('split') === 'string' && this.getProp('split')[0] === '/' && /[^\\]\$/.test(this.getProp('split'))) {
|
||||
data.address = this.getProp('split').replace(/([^\\])(\$)/g,'$1' + i).replace(/\\\$/g, '$')
|
||||
data.preArgs = '@{parent.preArgs}'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue