From 753a6d5128a487c3f49d88dfa224404791fb5050 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Sat, 2 Apr 2022 15:29:06 +0200 Subject: [PATCH] cripting: send(): ignore `ignoreDefaults` property --- CHANGELOG.md | 1 + resources/docs/docs/widgets/scripting.md | 4 ++-- src/client/widgets/common/widget.js | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4b17dc1..826c95c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - bug fixes - range: value update issue (internal touch state not updated properly) + - scripting: send(): ignore `ignoreDefaults` property ## 1.15.7 diff --git a/resources/docs/docs/widgets/scripting.md b/resources/docs/docs/widgets/scripting.md index d56f61fc..ca9261b8 100644 --- a/resources/docs/docs/widgets/scripting.md +++ b/resources/docs/docs/widgets/scripting.md @@ -161,7 +161,7 @@ Sets the value of a widget's custom variable (see [advanced syntaxes](./advanced ---- #### `send(target, address, ...args)` -- `target` (optional): `"ip:port"` or `"midi:device_name"` string. If omitted, the widget's target will be used. +- `target` (optional): `"ip:port"` or `"midi:device_name"` string. If omitted, the widget's target (or the server's defaults) will be used. - `address`: osc address, must start with a `/` - `args`: values or `{type: "OSC_TYPE_LETTER", value: VALUE}` objects @@ -169,7 +169,7 @@ Sends an osc message. If the event that triggered the script's execution was not initiated by a user interaction, this function will have no effect. -This function ignores the widget's `bypass` property. +This function ignores the widget's `bypass` and `ignoreDefaults` properties. ??? infos "Examples" ```javascript diff --git a/src/client/widgets/common/widget.js b/src/client/widgets/common/widget.js index e284e330..23ade29a 100644 --- a/src/client/widgets/common/widget.js +++ b/src/client/widgets/common/widget.js @@ -364,7 +364,7 @@ class Widget extends EventEmitter { v: this.getValue(true), } - if (this.getProp('ignoreDefaults')) data.i = 1 + if (this.getProp('ignoreDefaults') && !options.force) data.i = 1 if (overrides) { for (var k in overrides) {