Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
destroy() {
if (this.is('initialized')) {
if (this.options.theme) {
removeClass(this.getThemeClass(), this.$wrap)
}
removeClass(this.classes.DISABLED, this.$wrap)
removeClass(this.classes.CHECKED, this.$wrap)
if (this.is('wrapped')) {
unwrap(this.element)
this.$icon.remove()
}
this.unbind()
this.leave('initialized')
}
this.trigger(EVENTS.DESTROY)
super.destroy()
}
}
destroy() {
if (this.is('initialized')) {
this.unbind()
this.POPPER.destroy()
empty(this.element)
this.element.className = this.firstClassName
this.element.setAttribute('placeholder', '')
unwrap(unwrap(this.element))
this.$remove.remove()
this.PREVIEW.remove()
this.$panelWrap.remove()
if (this.options.theme) {
removeClass(this.getThemeClass(), this.element)
}
this.leave('initialized')
}
this.clear()
this.trigger(EVENTS.DESTROY)
super.destroy()
}
destroy() {
if (this.is('initialized')) {
this.unbind()
if (this.options.theme) {
removeClass(this.getThemeClass(), this.$wrapper)
}
this.POPPER.destroy()
unwrap(this.$element)
this.$element.className = this.firstClassName
this.$element.setAttribute('placeholder', null)
this.leave('initialized')
}
this.trigger(EVENTS.DESTROY)
super.destroy()
}
}
this.getClass(this.classes.TRIGGER, 'trigger', this.options.trigger),
this.$wrap
)
removeClass(
this.getClass(
this.classes.OUTSIDEPLACEMENT,
'placement',
this.options.placement
),
this.$wrap
)
if (this.$lens) {
this.$lens.remove()
}
} else {
unwrap(`.${this.classes.WRAP}`, this.$image)
}
if (this.LOADER) {
this.LOADER.destroy()
}
removeClass(this.classes.IMAGE, this.$image)
this.leave('initialized')
}
this.trigger(EVENTS.DESTROY)
super.destroy()
}
}
destroy() {
if (
!this.instance.is('built') ||
(this.mode === 'scroll' && this.instance.vertical)
) {
return
}
if (this.mode === 'drop') {
this.instance.navLabel.remove()
this.dropToggle(false)
} else if (this.mode === 'scroll') {
unwrap(this.instance.$nav)
this.scrollToggle(false)
}
removeClass(this.modeClass, this.instance.element)
this.instance.leave('built')
}
destroy() {
if (this.is('initialized')) {
this.unbind()
this.clear()
empty(this.element)
this.element.setAttribute('placeholder', '')
unwrap(unwrap(this.element))
if (!this.options.inline) {
this.PREVIEW.remove()
if (this.options.clearable) {
this.CLEARABLE.destroy()
}
}
this.$panel.remove()
if (this.options.theme) {
removeClass(this.getThemeClass(), this.element)
}
this.leave('initialized')
}
this.trigger(EVENTS.DESTROY)
super.destroy()
}
}
destroy() {
if (this.is('initialized')) {
this.unbind()
this.$list.remove()
if (this.options.theme) {
removeClass(this.getThemeClass(), this.$wrapper)
}
unwrap(this.element)
this.leave('initialized')
}
this.trigger(EVENTS.DESTROY)
super.destroy()
}
}