From 9e989596c25420bc15a005a52cabfbc425a51c72 Mon Sep 17 00:00:00 2001 From: nathan Date: Fri, 18 Mar 2022 14:39:12 -0600 Subject: [PATCH] Et2Dialog changes - Fix Et2Dialog.show_prompt() incorrectly returned too much, should be just the prompt value --- api/js/etemplate/Et2Dialog/Et2Dialog.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/api/js/etemplate/Et2Dialog/Et2Dialog.ts b/api/js/etemplate/Et2Dialog/Et2Dialog.ts index b9e18a55c8..1a9f427df0 100644 --- a/api/js/etemplate/Et2Dialog/Et2Dialog.ts +++ b/api/js/etemplate/Et2Dialog/Et2Dialog.ts @@ -646,7 +646,14 @@ export class Et2Dialog extends Et2Widget(ScopedElementsMixin(SlotMixin(LionDialo let dialog = 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: {