mirror of https://github.com/dirtbags/moth.git
Adding/removing inputs updates answer
This commit is contained in:
parent
53a299d635
commit
d7c1da6c2b
|
@ -38,7 +38,11 @@ function helperUpdateAnswer(event) {
|
||||||
|
|
||||||
function helperRemoveInput(e) {
|
function helperRemoveInput(e) {
|
||||||
let item = e.target.parentElement
|
let item = e.target.parentElement
|
||||||
|
let container = item.parentElement
|
||||||
item.remove()
|
item.remove()
|
||||||
|
|
||||||
|
var event = new Event("input")
|
||||||
|
container.dispatchEvent(event)
|
||||||
}
|
}
|
||||||
|
|
||||||
function helperExpandInputs(e) {
|
function helperExpandInputs(e) {
|
||||||
|
@ -58,6 +62,9 @@ function helperExpandInputs(e) {
|
||||||
newElement.querySelector("input").value = ""
|
newElement.querySelector("input").value = ""
|
||||||
|
|
||||||
container.insertBefore(newElement, item)
|
container.insertBefore(newElement, item)
|
||||||
|
|
||||||
|
var event = new Event("input")
|
||||||
|
container.dispatchEvent(event)
|
||||||
}
|
}
|
||||||
|
|
||||||
function helperActivate(e) {
|
function helperActivate(e) {
|
||||||
|
|
Loading…
Reference in New Issue