[IMP] web_editor: hide we-row with no visible widgets

Part of https://github.com/odoo/odoo/pull/53930
task-2157252
This commit is contained in:
qsm-odoo
2020-07-14 14:43:15 +00:00
parent 4b826abcfb
commit 8d57f21d7d
@@ -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);
}
},
//--------------------------------------------------------------------------