interface.js: allow specifying default value for form elements

This commit is contained in:
dogeystamp 2023-01-04 15:02:10 -05:00
parent 6964103c25
commit 7c95f79bfc
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38

View File

@ -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() {