From aace76b97ac6b81bfbfd74b78e3b385df2adb56c Mon Sep 17 00:00:00 2001 From: nathan Date: Mon, 25 Jul 2022 16:12:09 -0600 Subject: [PATCH] Fix camelCased attributes didn't work for more than 1 underscore Also fixes vfsSelect destroyed session --- api/js/etemplate/Et2Dialog/Et2Dialog.ts | 6 +++--- api/js/etemplate/Et2Widget/Et2Widget.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/js/etemplate/Et2Dialog/Et2Dialog.ts b/api/js/etemplate/Et2Dialog/Et2Dialog.ts index 0bfab4d753..6066d2ada7 100644 --- a/api/js/etemplate/Et2Dialog/Et2Dialog.ts +++ b/api/js/etemplate/Et2Dialog/Et2Dialog.ts @@ -222,7 +222,7 @@ export class Et2Dialog extends Et2Widget(ScopedElementsMixin(SlotMixin(LionDialo /** * Automatically destroy the dialog when it closes. Set to false to keep the dialog around. */ - destroy_on_close: Boolean, + destroyOnClose: Boolean, /** * Legacy-option for appending dialog into a specific dom node @@ -319,7 +319,7 @@ export class Et2Dialog extends Et2Widget(ScopedElementsMixin(SlotMixin(LionDialo } this.modal = true; this.dialog_type = Et2Dialog.PLAIN_MESSAGE; - this.destroy_on_close = true; + this.destroyOnClose = true; this.hideOnEscape = this.hideOnEscape === false ? false : true; this.__value = {}; @@ -398,7 +398,7 @@ export class Et2Dialog extends Et2Widget(ScopedElementsMixin(SlotMixin(LionDialo this.dispatchEvent(new Event('close')); - if(this.destroy_on_close) + if(this.destroyOnClose) { if(this._template_widget) { diff --git a/api/js/etemplate/Et2Widget/Et2Widget.ts b/api/js/etemplate/Et2Widget/Et2Widget.ts index 3503e84f0c..a05041e2ff 100644 --- a/api/js/etemplate/Et2Widget/Et2Widget.ts +++ b/api/js/etemplate/Et2Widget/Et2Widget.ts @@ -1375,7 +1375,7 @@ function transformAttributes(widget, mgr : et2_arrayMgr, attributes) { let parts = attribute.split('_'); if (attribute === 'parent_node') parts[1] = 'Id'; - attribute = parts.shift()+parts.map(part => part[0].toUpperCase()+part.substring(1)); + attribute = parts.shift() + parts.map(part => part[0].toUpperCase() + part.substring(1)).join(""); } const property = widget_class.getPropertyOptions(attribute);