fix custom fields (somehow input widgets had no readonly) and some JS errors

Et2Number still misses styles, thought it extends Et2Textbox
This commit is contained in:
ralf 2022-07-22 09:03:54 +02:00
parent 7b36c24dde
commit 817aba5af6
3 changed files with 17 additions and 35 deletions

View File

@ -19,9 +19,7 @@
<description value=" - "/> <description value=" - "/>
<description value="type"/> <description value="type"/>
</hbox> </hbox>
<menulist> <select id="types" no_lang="1" onchange="1"/>
<menupopup id="types" no_lang="1" onchange="1"/>
</menulist>
<button label="Delete" id="delete" onclick="app.admin.cf_type_delete"/> <button label="Delete" id="delete" onclick="app.admin.cf_type_delete"/>
<textbox blur="new name" id="name"/> <textbox blur="new name" id="name"/>
<button label="Create" id="create"/> <button label="Create" id="create"/>
@ -60,17 +58,15 @@
<nextmatch-sortheader label="Last modified" id="cf_modified"/> <nextmatch-sortheader label="Last modified" id="cf_modified"/>
</row> </row>
<row class="row" valign="top"> <row class="row" valign="top">
<menulist> <select id="${row}[cf_type2]" no_lang="1" multiple="true" empty_label="All" readonly="true"/>
<menupopup id="${row}[cf_type2]" no_lang="1" multiple="true" empty_label="All"/>
</menulist>
<description id="${row}[cf_name]" no_lang="1" /> <description id="${row}[cf_name]" no_lang="1" />
<vbox> <vbox>
<description id="${row}[cf_label]" no_lang="1"/> <description id="${row}[cf_label]" no_lang="1"/>
<description id="${row}[cf_label]"/> <description id="${row}[cf_label]"/>
</vbox> </vbox>
<customfields-types statustext="Type of customfield" id="{$row}[cf_type]"/> <customfields-types statustext="Type of customfield" id="{$row}[cf_type]" readonly="true"/>
<checkbox id="${row}[cf_needed]" selected_value="1" unselected_value="0"/> <checkbox id="${row}[cf_needed]" selected_value="1" unselected_value="0" readonly="true"/>
<select-account id="${row}[cf_private]" account_type="both"/> <select-account id="${row}[cf_private]" account_type="both" readonly="true"/>
<description id="${row}[cf_values]" no_lang="1" class="values"/> <description id="${row}[cf_values]" no_lang="1" class="values"/>
<vbox> <vbox>
<description id="${row}[cf_len]" no_lang="1"/> <description id="${row}[cf_len]" no_lang="1"/>
@ -78,8 +74,8 @@
</vbox> </vbox>
<description id="${row}[cf_order]" no_lang="1"/> <description id="${row}[cf_order]" no_lang="1"/>
<vbox> <vbox>
<date-time id="${row}[cf_modified]"/> <date-time id="${row}[cf_modified]" readonly="true"/>
<select-account id="${row}[cf_modifier]"/> <select-account id="${row}[cf_modifier]" readonly="true"/>
</vbox> </vbox>
</row> </row>
</rows> </rows>

View File

@ -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) transformAttributes(attrs)
{ {
if (attrs.precision === 0 && typeof attrs.step === 'undefined') 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 * @param regexp
*/ */

View File

@ -940,6 +940,11 @@ const Et2WidgetMixin = <T extends Constructor>(superClass : T) =>
return null; return null;
} }
getParentDOMNode() : HTMLElement
{
return this._parent_node;
}
addChild(child : et2_widget | Et2WidgetClass) addChild(child : et2_widget | Et2WidgetClass)
{ {
if(this._children.indexOf(child) >= 0) if(this._children.indexOf(child) >= 0)