summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js
diff options
context:
space:
mode:
authorSamuel Degueldre <sad@odoo.com>2020-02-10 11:12:14 +0000
committerSamuel Degueldre <sad@odoo.com>2020-02-10 13:48:40 +0000
commit99427c2c5a44d3dd849b318fb3f580c3e9dd2d2a (patch)
tree91ef19662a962b90c14601f031955182c48cb1e9 /addons/web_editor/static/src/js
parent574bf9bb126a090d1d3a7f4de1fc27beab46a9d6 (diff)
[FIX] web_editor: fix apply-to methods not being awaited
When the apply-to data attribute was first introduced, a mistake was made when storing the results of the methods calls, using _.each instead of _.map to associate each target element with the promise of the method execution, as a result, Promise.all would resolve immediately instead of waiting. While there are no currently documented bug caused by this, they are just waiting to happen. This commit fixes that. closes odoo/odoo#44988 X-original-commit: 32271be1f696c11b3e5157426b8f7c9efa93134b Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Diffstat (limited to 'addons/web_editor/static/src/js')
-rw-r--r--addons/web_editor/static/src/js/editor/snippets.options.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web_editor/static/src/js/editor/snippets.options.js b/addons/web_editor/static/src/js/editor/snippets.options.js
index f21cb7a80ff..38b3045040c 100644
--- a/addons/web_editor/static/src/js/editor/snippets.options.js
+++ b/addons/web_editor/static/src/js/editor/snippets.options.js
@@ -2059,7 +2059,7 @@ const SnippetOptionWidget = Widget.extend({
if (params.applyTo) {
const $subTargets = this.$(params.applyTo);
- const proms = _.each($subTargets, subTargetEl => {
+ const proms = _.map($subTargets, subTargetEl => {
const proxy = createPropertyProxy(this, '$target', $(subTargetEl));
return this[methodName].call(proxy, previewMode, widgetValue, params);
});