From 3aaa03d7745551086095e846b7f58ded890cc3fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 6 Nov 2024 18:01:51 +0100 Subject: [PATCH] Set grid template to container of board view Closes #13663 (grafted from 27aed5d80c2c7ca9229faba7c8983a255096fb1f) --HG-- branch : 7.0 --- sao/src/board.js | 19 +++++++++++++++++-- sao/src/sao.less | 2 +- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/sao/src/board.js b/sao/src/board.js index 5760b6ca6f..3541cac777 100644 --- a/sao/src/board.js +++ b/sao/src/board.js @@ -7,6 +7,7 @@ _parse_board: function(node, attributes) { var container = new Sao.View.Form.Container( Number(node.getAttribute('col') || 4)); + this.view.containers.push(container); this.view.el.append(container.el); this.parse_child(node, container); if (this._containers.length > 0) { @@ -52,9 +53,23 @@ for (i = 0; i < this.actions.length; i++) { this.actions[i].display(); } - for (i = 0; i < this.state_widgets.length; i++) { - this.state_widgets[i].set_state(null); + var promesses = []; + for (let state_widget of this.state_widgets.toReversed()) { + var prm = state_widget.set_state(null); + if (prm) { + promesses.push(prm); + } } + for (const container of this.containers) { + container.set_grid_template(); + } + // re-set the grid templates for the StateWidget that are + // asynchronous + jQuery.when.apply(jQuery, promesses).done(() => { + for (const container of this.containers) { + container.set_grid_template(); + } + }); }, active_changed: function(event_action) { for (const action of this.actions) { diff --git a/sao/src/sao.less b/sao/src/sao.less index b0b672725d..2e10d44d71 100644 --- a/sao/src/sao.less +++ b/sao/src/sao.less @@ -629,7 +629,7 @@ img.icon { } } -.form { +.form, .board { width: 100%; .form-container, .form-hcontainer, .form-vcontainer { display: grid;