From b67513625d83204e47f687111b4fa2168409c001 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Thu, 5 Oct 2017 11:01:52 +0200 Subject: [PATCH] input: when submitting a value to another widget, the feedback from this widget doesn't trigger a second osc message anymore --- CHANGELOG.md | 2 +- src/browser/js/app/widgets/inputs/input.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57f1942c..b19eede1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ - messages received almost simultaneously are now bundled before being sent to the clients. This helps preserving their order. - widgets - sliders/pads: when receiving feedback while touched, the widget waits to be released before updating to the latest received value. - - input: the widget's value is no longer validated when leaving focus by clicking somewhere else or hitting the `Tab` key (it must be submitted by hitting the `Enter` key) + - input: the widget's value is no longer validated when leaving focus by clicking somewhere else or hitting the `Tab` key (it must be submitted by hitting the `Enter` key); when submitting a value to another widget, the feedback from this widget doesn't trigger a second osc message anymore - misc - property fields are now parsed using [JSON5](https://github.com/json5/json5), a more flexible notation. Session files are still written in standard JSON format, this is just a way to avoid typing mistakes when using the editor. - remote editing also accepts JSON5 notation diff --git a/src/browser/js/app/widgets/inputs/input.js b/src/browser/js/app/widgets/inputs/input.js index 7f4ec017..d87df412 100644 --- a/src/browser/js/app/widgets/inputs/input.js +++ b/src/browser/js/app/widgets/inputs/input.js @@ -154,12 +154,14 @@ module.exports = class Input extends _canvas_base { for (var i=widget.length-1; i>=0; i--) { if (widget[i].setValue) { widget[i].setValue(this.value, options) - this.setValue(widget[i].getValue(), {...options, internal:true}) + this.setValue(widget[i].getValue(), {...options, internal:true, sentOnce:options.send}) return } } } + if (options.sentOnce) options.send = false + this.stringValue = this.getStringValue() this.draw()