Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
bindEvent(this.eventName('click'), `.${this.classes.ITEMRESELECT}`, e => {
e.stopPropagation()
if (this.is('disabled')) {
return false
}
this.options.change.call(this, this.changeImage.bind(this))
const getElementIndex = el => {
const parentElement = parent(el)
return children(parentElement).indexOf(el)
}
const index = getElementIndex(
parentWith(hasClass(this.classes.ITEM), e.target)
)
this.change(index, this.url)
return null
}),
// save
init(el, _package = false) {
this.instance.enter('keyboard')
this._package = _package
this.$list = el
this.$wrap = this._package
? parentWith(hasClass(this.classes.PACKAGE), this.$list[0])
: parent(this.$list[0])
this.$input = query('input', this.instance.$search)
this.$fontList = null
this.$selected = null
this.downCount = 1
this.upCount = 1
this.bind()
}
nextPage() {
if (this.instance.mode === 'multiple') {
this.instance.next(this.instance.focused)
} else if (
!hasClass(
this.instance.classes.BLOCKED,
this.instance.calendarNexts[this.instance.focused]
)
) {
this.instance.next(this.instance.focused, true)
}
}
higherView() {
hideList() {
removeClass(this.classes.MONTHSHOWLIST, this.$wrap)
//
for (let i = 1; i < this.events.length; i++) {
if (!hasClass(this.classes.HIDE, this.events[i])) {
addClass(this.classes.HIDE, this.events[i])
}
}
this.showMore()
}
hide() {
if (!hasClass(this.classes.HIDE, this.$element)) {
addClass(this.classes.HIDE, this.$element)
}
}
show() {
if (hasClass(this.classes.HIDE, this.$element)) {
removeClass(this.classes.HIDE, this.$element)
}
}
}
hide() {
if (!hasClass(this.classes.HIDE, this.$element)) {
addClass(this.classes.HIDE, this.$element)
}
}
}
}
let nextItem = addClass(this.classes.NEXT, next(activeItem))
if (this.options.loop && !this.options.multiple && !isElement(nextItem)) {
nextItem = this.items[0]
addClass(this.classes.NEXT, nextItem)
}
let prevItem = addClass(this.classes.PREV, prev(activeItem))
if (this.options.loop && !this.options.multiple && !isElement(prevItem)) {
prevItem = this.items[this.items.length - 1]
addClass(this.classes.PREV, prevItem)
}
if (this.options.loop && !this.options.multiple) {
if (hasClass(this.classes.CLONED, nextItem)) {
children(
`.${this.classes.ITEM}:not(.${
this.classes.CLONED
})[data-swipe-item-index="${attr(
'data-swipe-item-index',
nextItem
)}"]`,
this.$inner
).forEach(children => {
addClass(this.classes.CLONEDNEXT, children)
})
} else {
children(
`.${this.classes.ITEM}.${
this.classes.CLONED
}[data-swipe-item-index="${attr(
getWrap() {
return parentWith(hasClass(this.classes.WRAP), this.element)
},
getLabel() {
() => {
if (this.is('disbaled')) {
return null
}
this.enter('save')
if (hasClass(this.classes.SHOW, this.$wrap)) {
removeClass(
this.classes.SHOW,
addClass(this.classes.EXIST, this.$wrap)
)
}
this.DROPDOWN.hide()
removeClass(this.classes.OPENDISABLE, this.TRIGGER.$trigger)
removeClass(this.classes.WRITE, this.$wrap)
return false
},
this.$save