Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
updateOverflow() {
if (this.options.overflow === false) {
return
}
const containerWidth = contentWidth(parent(this.$wrap))
const width = contentWidth(this.$wrap)
let totalWidth
const $items = []
if (this.$wrap.scrollWidth > containerWidth) {
append(this.$toggle, this.$wrap)
totalWidth = outerWidth(this.$toggle)
childrenMatchSelector('[data-value]', this.$wrap).forEach($item => {
const itemWidth = outerWidth($item)
$item.dataset.width = itemWidth
totalWidth += itemWidth
if (totalWidth > width) {
$items.push($item)
}
})
updateOverflow() {
if (this.options.overflow === false) {
return
}
const containerWidth = contentWidth(parent(this.$wrap))
const width = contentWidth(this.$wrap)
let totalWidth
const $items = []
if (this.$wrap.scrollWidth > containerWidth) {
append(this.$toggle, this.$wrap)
totalWidth = outerWidth(this.$toggle)
childrenMatchSelector('[data-value]', this.$wrap).forEach($item => {
const itemWidth = outerWidth($item)
$item.dataset.width = itemWidth
totalWidth += itemWidth
if (totalWidth > width) {
$items.push($item)
}
})
$items.reverse().forEach($item => {