Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
initFilter() {
const items = []
this.classType.forEach(item => {
items.push({
text: item,
id: item
})
})
const $filter = document.createElement('div')
const that = this
this.filterApi = Filters.of($filter, {
default: this.instance.currentClass,
items,
onChange: () => {
if (!that.filterApi) {
return
}
const className = that.filterApi.get()
this.instance.switchClass(className)
}
})
this.filterApi.set(this.instance.currentClass)
append($filter, this.$element)
}
that.instance.filter(tag !== 'all' ? [tag] : [])
}
}
tags.forEach(tag => {
items.push({
text: tag,
id: tag
})
})
config.items = items
this.$filters = find(`.${this.classes.FILTERS}`, this.instance.element)
Filters.of(this.$filters, config)
}
onChange(tag) {
that.api.filter(tag !== 'all' ? [tag] : [])
}
}
tags.forEach(tag => {
items.push({
text: tag,
id: tag
})
})
config.items = items
this.$filters = find(`.${this.classes.FILTERS}`, this.api.element)
Filters.of(this.$filters, config)
}
import { query } from '@pluginjs/dom'
import Filter from '@pluginjs/filters'
const element = query('#responsive .pj-filters')
Filter.of(element, {
responsive: true
})