From 817aba5af6b20e9b254de3beca0c79ee178177eb Mon Sep 17 00:00:00 2001 From: ralf Date: Fri, 22 Jul 2022 09:03:54 +0200 Subject: [PATCH] fix custom fields (somehow input widgets had no readonly) and some JS errors Et2Number still misses styles, thought it extends Et2Textbox --- admin/templates/default/customfields.xet | 26 ++++++++++-------------- api/js/etemplate/Et2Textbox/Et2Number.ts | 21 +------------------ api/js/etemplate/Et2Widget/Et2Widget.ts | 5 +++++ 3 files changed, 17 insertions(+), 35 deletions(-) diff --git a/admin/templates/default/customfields.xet b/admin/templates/default/customfields.xet index 819e362802..86321d9614 100644 --- a/admin/templates/default/customfields.xet +++ b/admin/templates/default/customfields.xet @@ -15,13 +15,11 @@ - - - + + + - - - + - - - + + + @@ -78,8 +74,8 @@ - - + + @@ -92,4 +88,4 @@ - + \ No newline at end of file diff --git a/api/js/etemplate/Et2Textbox/Et2Number.ts b/api/js/etemplate/Et2Textbox/Et2Number.ts index c89bb62324..8b8070a785 100644 --- a/api/js/etemplate/Et2Textbox/Et2Number.ts +++ b/api/js/etemplate/Et2Textbox/Et2Number.ts @@ -35,25 +35,6 @@ export class Et2Number extends Et2Textbox } } - /** @param {import('@lion/core').PropertyValues } changedProperties */ - updated(changedProperties) - { - super.updated(changedProperties); - - if (changedProperties.has('min')) - { - this._inputNode.min = this.min; - } - if (changedProperties.has('max')) - { - this._inputNode.max = this.max; - } - if (changedProperties.has('step')) - { - this._inputNode.step = this.step; - } - } - transformAttributes(attrs) { if (attrs.precision === 0 && typeof attrs.step === 'undefined') @@ -69,7 +50,7 @@ export class Et2Number extends Et2Textbox } /** - * Somehow the setter is not inherited fro the parent, not defining it here leaves the validator a string! + * Somehow the setter is not inherited from the parent, not defining it here leaves the validator a string! * * @param regexp */ diff --git a/api/js/etemplate/Et2Widget/Et2Widget.ts b/api/js/etemplate/Et2Widget/Et2Widget.ts index 191b20ce47..8cbe6babfb 100644 --- a/api/js/etemplate/Et2Widget/Et2Widget.ts +++ b/api/js/etemplate/Et2Widget/Et2Widget.ts @@ -940,6 +940,11 @@ const Et2WidgetMixin = (superClass : T) => return null; } + getParentDOMNode() : HTMLElement + { + return this._parent_node; + } + addChild(child : et2_widget | Et2WidgetClass) { if(this._children.indexOf(child) >= 0)