interface.js: allow specifying default value for form elements
This commit is contained in:
parent
6964103c25
commit
7c95f79bfc
@ -218,7 +218,7 @@ function bufToB64 (buf) {
|
||||
}
|
||||
|
||||
class FormElement extends InterfaceElement {
|
||||
constructor({tag, labelTag, label="", fragment, dataType, advanced=false, enabled=true, enabledFunc}) {
|
||||
constructor({tag, labelTag, label="", value, fragment, dataType, advanced=false, enabled=true, enabledFunc}) {
|
||||
super({fragment, enabled, enabledFunc});
|
||||
|
||||
this.labelText = label;
|
||||
@ -238,6 +238,8 @@ class FormElement extends InterfaceElement {
|
||||
this.advanced = advanced;
|
||||
|
||||
if (this.advanced === true) this.hidden = true;
|
||||
|
||||
if (value !== undefined) this.value = value;
|
||||
}
|
||||
|
||||
get value() {
|
||||
|
Loading…
Reference in New Issue
Block a user