jsdialog: run postProcess also on containers

- added TODO: identify containers correctly by id from JSON not
  with additional prefixes, this needs revisiting css rules...
  so do not do it now
- run postProcess on containers to hide them if needed

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I8027bf1fd54e18a8cd3f7b85617d1606e9b33a88
This commit is contained in:
Szymon Kłos 2021-11-23 18:41:27 +01:00 committed by Szymon Kłos
parent e5ef35f716
commit e34374bba2

View file

@ -2958,11 +2958,20 @@ L.Control.JSDialogBuilder = L.Control.extend({
var hasManyChildren = childData.children && childData.children.length > 1;
if (hasManyChildren && childData.type !== 'buttonbox') {
var tableId = childData.id ? 'table-' + String(childData.id).replace(' ', '') : '';
var table = L.DomUtil.createWithId('div', tableId, td);
// TODO: remove 'table-' prefix, we need exactly the same id so events coming from core
// will reach the elements, for postprocess we need to temporary switch the id in childData
var backupId = childData.id;
childData.id = childData.id ? 'table-' + String(childData.id).replace(' ', '') : '';
var table = L.DomUtil.createWithId('div', childData.id, td);
$(table).addClass(this.options.cssClass);
$(table).addClass('vertical');
var childObject = L.DomUtil.create('div', 'row ' + this.options.cssClass, table);
this.postProcess(td, childData);
// revert correct id
childData.id = backupId;
} else {
childObject = td;
}