Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
lists.forEach((list, index) => {
const listControl = new MDCList(list)
listControl.listElements.map((listItemEl) => new MDCRipple(listItemEl))
listControl.singleSelection = this.props.singleSelection
listControl.listen('MDCList:action', (evt: any) => {
this.fire('itemclick', { item: this.props.items[evt.detail.index], index: evt.detail.index })
// if(this.listAll[index][evt.detail.index]) {
// this.fire('change', this.listAll[index][evt.detail.index])
// } else {
// this.fire('change', this.listAll[index+1][evt.detail.index])
// }
})
})
})
public componentDidMount() {
super.componentDidMount();
if (this.control) {
this.MDComponent = new MDCList(this.control);
this.MDComponent.listen('MDCList:action', this.onAction);
}
}
window.setTimeout(() => {
for (const listEl of document.querySelectorAll(
'.list-bulk-button, .list-items'
)) {
const list = new MDCList(listEl);
for (const el of list.listElements) {
MDCRipple.attachTo(el);
}
}
}, 500);
}
window.setTimeout(() => {
for (const listEl of document.querySelectorAll(
'.list-bulk-button, .list-items'
)) {
const list = new MDCList(listEl);
for (const el of list.listElements) {
MDCRipple.attachTo(el);
}
}
}, 500);
}
lists.forEach((list, index) => {
const listControl = new MDCList(list)
listControl.listElements.map((listItemEl) => new MDCRipple(listItemEl))
listControl.listen('MDCList:action', (evt: any) => {
if(this.listAll[index][evt.detail.index]) {
this.fire('change', this.listAll[index][evt.detail.index])
} else {
this.fire('change', this.listAll[index+1][evt.detail.index])
}
})
})
})
window.setTimeout(() => {
for (const listEl of document.querySelectorAll(
'.list-bulk-button, .list-items'
)) {
const list = new MDCList(listEl);
for (const el of list.listElements) {
MDCRipple.attachTo(el);
}
}
}, 500);
}