How to use the @pluginjs/dom.unwrap function in @pluginjs/dom

To help you get started, we’ve selected a few @pluginjs/dom examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pluginjs / pluginjs / modules / checkbox / src / main.js View on Github external
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()
  }
}
github pluginjs / pluginjs / modules / color-picker / src / main2.js View on Github external
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()
  }
github pluginjs / pluginjs / modules / auto-complete / src / main.js View on Github external
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()
  }
}
github pluginjs / pluginjs / modules / magnify / src / main.js View on Github external
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()
  }
}
github pluginjs / pluginjs / modules / tabs / src / responsive.js View on Github external
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')
  }
github pluginjs / pluginjs / modules / gradient-picker / src / main.js View on Github external
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()
  }
}
github pluginjs / pluginjs / modules / list / src / main.js View on Github external
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()
  }
}