Et2Dialog changes

- Fix Et2Dialog.show_prompt() incorrectly returned too much, should be just the prompt value
This commit is contained in:
nathan 2022-03-18 14:39:12 -06:00
parent 238a22ba01
commit 9e989596c2

View File

@ -646,7 +646,14 @@ export class Et2Dialog extends Et2Widget(ScopedElementsMixin(SlotMixin(LionDialo
let dialog = <Et2Dialog><unknown>document.createElement('et2-dialog');
dialog._setApiInstance();
dialog.transformAttributes({
callback: _callback,
// Wrap callback to _only_ return _value.value, not the whole object like we normally would
callback: function(_button_id, _value)
{
if(typeof _callback == "function")
{
_callback.call(this, _button_id, _value.value);
}
},
title: _title || 'Input required',
buttons: _buttons || Et2Dialog.BUTTONS_OK_CANCEL,
value: {