From 9d2fe8a91ab8842499ae0f032c524d8a330c2471 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 2 Jan 2019 09:36:11 +0100 Subject: [PATCH] matrix: inherit from id and osc properties by default (#450) --- CHANGELOG.md | 5 +++-- src/client/app/widgets/matrices/matrix.js | 10 ++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b024571..a741c3bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,9 +3,10 @@ ## 0.40.5 - bug fixes - - clone: editor's selection rectangle appearing after editing the clone's target widget + - clone: editor's selection rectangle appearing after editing the clone's target widget - widgets - - input: hitting `tab` now validates the value before focusing the next input (hitting `esc` or clicking outside the widget still cancels); when focusing an input widget, its whole value is selected by default; focused/selected text color hint changes. + - input: hitting `tab` now validates the value before focusing the next input (hitting `esc` or clicking outside the widget still cancels); when focusing an input widget, its whole value is selected by default; focused/selected text color hint changes. + - matrix: widgets inherit from the matrix' `id` and osc properties by default ## 0.40.4 diff --git a/src/client/app/widgets/matrices/matrix.js b/src/client/app/widgets/matrices/matrix.js index 693c9818..cdee601c 100644 --- a/src/client/app/widgets/matrices/matrix.js +++ b/src/client/app/widgets/matrices/matrix.js @@ -17,7 +17,8 @@ class Matrix extends _matrix_base { border: {type: 'boolean', value: true, help: 'Set to `false` to disables the widgets\' borders'}, props: {type: 'object', value: {}, help: [ 'Defines a set of property to override the widgets\' defaults.', - 'Formulas in this field are resolved with an extra variable representing each widget\'s index: `$`' + 'Formulas in this field are resolved with an extra variable representing each widget\'s index: `$`', + 'Note: by default, the widgets inherit from the matrix\' `id` and osc properties (`id` and `address` are appended with `/$`)' ]} }, [], {}) @@ -43,7 +44,12 @@ class Matrix extends _matrix_base { var props = this.resolveProp('props', undefined, false, false, false, {'$':i}) var data = { type: this.getProp('widgetType'), - id: this.getProp('id') + '/' + i, + id: '@{parent.id}/' + i, + address: '@{parent.address}/' + i, + preArgs: '@{parent.preArgs}', + target: '@{parent.target}', + precision: '@{parent.precision}', + bypass: '@{parent.bypass}', label: i, top: 'auto', left: 'auto',