Added a first version of data-autoset

This commit is contained in:
Florian Bouillon 2019-10-08 17:36:19 +02:00
parent 5f3ba54ccf
commit aab4c0bc66
No known key found for this signature in database
GPG Key ID: B143FF27EF555D16

View File

@ -167,6 +167,16 @@ export default class FormManager {
//Setup the system for basic inputs //Setup the system for basic inputs
this.setupInputs() this.setupInputs()
setInterval(() => {
this.form.querySelectorAll("[data-autoset]").forEach((el: HTMLInputElement) => {
let autosetStr = el.dataset.autoset
if (autosetStr.startsWith("run:")) {
let tmp = autosetStr.split("run:")[1]
el.value = eval(tmp)
}
})
}, 500)
} }
/** /**