From 08107e7928379eff844f9117a731e17be79e6d70 Mon Sep 17 00:00:00 2001 From: bordun Date: Wed, 28 Oct 2020 10:36:08 +0100 Subject: [PATCH] scripting: `send()` now ignores the widget's `bypass` property (allows bypassing default messages and define custom ones). --- CHANGELOG.md | 1 + resources/docs/docs/widgets/scripting.md | 2 ++ src/client/widgets/scripts/script-vm.js | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 738af287..5711ee0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - widgets - all: add `html` property to allow inserting custom content in widgets (label, value, etc) and style it with the `css` property. + - scripting: `send()` now ignores the widget's `bypass` property (allows bypassing default messages and define custom ones). - custom module - automatically reload custom module when the file is modified diff --git a/resources/docs/docs/widgets/scripting.md b/resources/docs/docs/widgets/scripting.md index 81cdf34f..46325da8 100644 --- a/resources/docs/docs/widgets/scripting.md +++ b/resources/docs/docs/widgets/scripting.md @@ -79,6 +79,8 @@ If the event that triggered the script's execution was initiated by a user inter 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. + ---- #### `getProp(id, name)` diff --git a/src/client/widgets/scripts/script-vm.js b/src/client/widgets/scripts/script-vm.js index 0c1a1452..521eec8d 100644 --- a/src/client/widgets/scripts/script-vm.js +++ b/src/client/widgets/scripts/script-vm.js @@ -100,7 +100,7 @@ class ScriptVm extends Vm { var widget = this.getWidget() if (widget.builtIn) widget = widget.parent - widget.sendValue(overrides) + widget.sendValue(overrides, {force: true}) }