Updated RepeatInput

Signed-off-by: Avior <florian.bouillon@delta-wings.net>
This commit is contained in:
Florian Bouillon 2019-12-05 09:56:55 +01:00
parent 9b85d0a06a
commit 9dc6a44973
No known key found for this signature in database
GPG Key ID: B143FF27EF555D16

View File

@ -10,7 +10,7 @@ import InputIdentity from './Interfaces/InputIdentity';
*/ */
export default class RepeatInput extends DefaultInput { export default class RepeatInput extends DefaultInput {
elements: InputAbstract[][] = [] public elements: InputAbstract[][] = []
private template: DocumentFragment private template: DocumentFragment
@ -75,7 +75,6 @@ export default class RepeatInput extends DefaultInput {
const clone = document.importNode(this.template, true) const clone = document.importNode(this.template, true)
this.element.insertBefore(clone, this.addBtn) this.element.insertBefore(clone, this.addBtn)
let node = this.element.children.item(this.element.childElementCount-2) as HTMLElement let node = this.element.children.item(this.element.childElementCount-2) as HTMLElement
console.log(node)
node.classList.add("fmr-element") node.classList.add("fmr-element")
node.style.display = "" node.style.display = ""
@ -83,7 +82,6 @@ export default class RepeatInput extends DefaultInput {
let sub: InputAbstract[] = []; let sub: InputAbstract[] = [];
(node.querySelectorAll("[data-input]") as NodeListOf<HTMLElement>).forEach((el: HTMLElement) => { (node.querySelectorAll("[data-input]") as NodeListOf<HTMLElement>).forEach((el: HTMLElement) => {
let input = this.form.getInit(el) let input = this.form.getInit(el)
console.log(input, values)
if (!input) { if (!input) {
return return
} }