Fix missing button labels from legacy dialog

This commit is contained in:
nathan 2022-03-23 13:42:12 -06:00
parent 9693cfe538
commit 79fab93351

View File

@ -71,6 +71,23 @@ export class et2_dialog extends Et2Dialog
super.template = value; super.template = value;
} }
_getButtons() : any
{
if(Array.isArray(this.buttons) && this.buttons[0].text)
{
console.warn("Button definitions should follow DialogButton interface", this, this.buttons);
return this.buttons.map((button) =>
{
if(button.text)
{
button.label = button.text;
}
return button;
});
}
return super._getButtons();
}
/** /**
* @deprecated * @deprecated
* @returns {any} * @returns {any}