diff options
| author | qsm-odoo <qsm@odoo.com> | 2020-07-13 10:16:31 +0000 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2020-07-14 14:43:15 +0000 |
| commit | 8d57f21d7df2033f462ead60fcb5abba4546213e (patch) | |
| tree | 8dee713e2c74166298de02d251f57459efea527f /addons/web_editor/static/src/js | |
| parent | 4b826abcfb35672dfacfd88feba90aba3d02eff2 (diff) | |
[IMP] web_editor: hide we-row with no visible widgets
Part of https://github.com/odoo/odoo/pull/53930
task-2157252
Diffstat (limited to 'addons/web_editor/static/src/js')
| -rw-r--r-- | addons/web_editor/static/src/js/editor/snippets.options.js | 9 |
1 files changed, 8 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 86165217120..81863acf470 100644 --- a/addons/web_editor/static/src/js/editor/snippets.options.js +++ b/addons/web_editor/static/src/js/editor/snippets.options.js @@ -1951,7 +1951,14 @@ const SnippetOptionWidget = Widget.extend({ const showUI = await this._computeVisibility(); this.el.classList.toggle('d-none', !showUI); - return Promise.all(proms); + await Promise.all(proms); + + // Hide rows which contains only hidden widgets + for (const rowEl of this.$el.find('we-row')) { + // TODO improve this, this is hackish to rely on DOM structure + // here. Rows should be handled as widgets or something like that. + rowEl.classList.toggle('d-none', $(rowEl).find('> div > .o_we_user_value_widget:not(.d-none)').length === 0); + } }, //-------------------------------------------------------------------------- |
