jsdialog: fix help buttons

Responses have to be handled even in top level widget.
After rework we sometimes didn't handle responses
because we didn't call container handler.
Put it in a build function also.

Bug was in find & replace dialog, help didn't work

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I07a69c071b65c6574a1656c71aa7eab361f7e729
This commit is contained in:
Szymon Kłos 2023-03-22 10:58:23 +01:00 committed by Szymon Kłos
parent aa47a9f0a9
commit f4a9c2dd19
2 changed files with 15 additions and 9 deletions

View file

@ -495,6 +495,16 @@ L.Control.JSDialogBuilder = L.Control.extend({
return builder._containerHandler(parentContainer, data, builder);
},
_handleResponses: function(data, builder) {
// Dialogue is a parent container of a buttonbox, so we will save the responses first, then we will check them while creating the buttons.
if (data.responses) {
for (var i in data.responses) {
// Button id = response
builder._responses[data.responses[i].id] = data.responses[i].response;
}
}
},
_containerHandler: function(parentContainer, data, builder) {
if (data.cols && data.rows) {
return builder._gridHandler(parentContainer, data, builder);
@ -503,15 +513,6 @@ L.Control.JSDialogBuilder = L.Control.extend({
if (parentContainer && !parentContainer.id)
parentContainer.id = data.id;
// Dialogue is a parent container of a buttonbox, so we will save the responses first, then we will check them while creating the buttons.
if ((data.type === 'dialog' || data.type === 'messagebox' || data.type === 'modelessdialog')
&& data.responses) {
for (var i in data.responses) {
// Button id = response
builder._responses[data.responses[i].id] = data.responses[i].response;
}
}
return true;
},
@ -3067,6 +3068,8 @@ L.Control.JSDialogBuilder = L.Control.extend({
var childType = childData.type;
this._handleResponses(childData, this);
var containerToInsert = parent;
if (childData.dialogid)

View file

@ -701,6 +701,9 @@ L.Control.MobileWizardBuilder = L.Control.JSDialogBuilder.extend({
var childData = data[childIndex];
if (!childData)
continue;
this._handleResponses(childData, this);
this._parentize(childData);
var childType = childData.type;
var processChildren = true;