diff options
| author | qsm-odoo <qsm@odoo.com> | 2019-12-18 16:44:15 +0000 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2019-12-19 10:06:54 +0000 |
| commit | 2ebe088def2cba6b89da325f8a3852afe1afb0a2 (patch) | |
| tree | 788c2073a3c1d6a7b21a45810171d86e18b16920 /addons/web_editor | |
| parent | d08023f06ae8c211a83414b9164e4c7bcb0f6367 (diff) | |
[FIX] web_editor: missing use of applyTo param for visibility update
Part of https://github.com/odoo/odoo/pull/42136
Diffstat (limited to 'addons/web_editor')
| -rw-r--r-- | addons/web_editor/static/src/js/editor/snippets.options.js | 13 |
1 files changed, 12 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 4a465ffe3df..435e6f8beb1 100644 --- a/addons/web_editor/static/src/js/editor/snippets.options.js +++ b/addons/web_editor/static/src/js/editor/snippets.options.js @@ -1565,7 +1565,18 @@ const SnippetOptionWidget = Widget.extend({ updateUIVisibility: async function () { const proms = this._userValueWidgets.map(async widget => { const params = widget.getMethodsParams(); - const show = await this._computeWidgetVisibility(widget.getName(), params); + + let obj = this; + if (params.applyTo) { + const $firstSubTarget = this.$(params.applyTo).eq(0); + if (!$firstSubTarget.length) { + widget.toggleVisibility(false); + return; + } + obj = createPropertyProxy(this, '$target', $firstSubTarget); + } + + const show = await this._computeWidgetVisibility.call(obj, widget.getName(), params); if (!show) { widget.toggleVisibility(false); return; |
