How to use the @pluginjs/dom.prepend 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 / lightbox / src / components / slide / modules / inline.js View on Github external
init() {
    this.inline = this.instance.getElement('inline')
    prepend(this.inline, this.content)
  }
github pluginjs / pluginjs / modules / lightbox / src / components / slide / modules / image.js View on Github external
init() {
    this.image = this.instance.getElement('image')

    this.image.ondragstart = () => false

    prepend(this.image, this.content)
  }
github pluginjs / pluginjs / modules / grids / src / components / toolbar.js View on Github external
classes: this.classes
        }
      )
    }

    this.toolbar = templateEngine.render(
      this.api.options.templates.toolbar.call(this),
      {
        classes: this.classes,
        filters: this.filters,
        sort: this.sort,
        reverse: this.reverse
      }
    )

    prepend(this.toolbar, this.api.element)

    this.handleFilters()
    this.handleSort()
    this.handleReverse()
  }
github pluginjs / pluginjs / modules / rate / src / main.js View on Github external
iconClass: this.options.iconClass
      })

      unit = templateEngine.render(this.options.templates.unit.call(this), {
        classes: this.classes,
        icon
      })
    }

    const html = templateEngine.render(this.options.template.call(this), {
      classes: this.classes
    })

    const wrap = parseHTML(html)
    for (let i = 0; i < this.options.max; i++) {
      prepend(unit, wrap)
    }

    return wrap
  }
github pluginjs / pluginjs / modules / radio / src / main.js View on Github external
createIcon() {
    this.$icon = this.options.getIcon.call(this)

    if (!this.$icon) {
      this.$icon = parseHTML(
        template.render(this.options.templates.icon.call(this), {
          classes: this.classes
        })
      )
      prepend(this.$icon, this.$label)
    }
  }
github pluginjs / pluginjs / modules / range / src / main.js View on Github external
initialize() {
    this.$wrap = wrap(`<div class="${this.classes.WRAP}"></div>`, this.element)
    this.$control = document.createElement('div')
    prepend(this.$control, this.$wrap)

    if (this.options.input) {
      addClass(this.classes.INPUT, this.element)
    } else {
      setStyle('display', 'none', this.element)
    }

    addClass(this.classes.WRAP, this.$wrap)
    addClass(this.classes.CONTROL, this.$control)

    if (this.options.theme) {
      addClass(this.getThemeClass(), this.$wrap)
    }

    if (this.options.vertical) {
      addClass(this.classes.VERTICAL, this.$wrap)
github pluginjs / pluginjs / modules / zoom / src / mode / window.js View on Github external
this.windowImage = query(`.${this.classes.WINDOWIMAGE}`, this.window)
    this.lens = parseHTML(this.creatHTML('lens'))
    if (this.configuration.overlay) {
      this.overlayContainer = parseHTML(this.creatHTML('overlay'))
      this.overlay = query(`.${this.classes.OVERLAY}`, this.overlayContainer)
      this.lensImage = parseHTML(this.creatHTML('lensImage'))
    }

    this.setStyle()
    addClass(this.getClass('{namespace}-modeWindow'), this.container)
    append(this.window, this.container)

    if (!this.configuration.overlay) {
      append(this.lens, this.container)
    } else {
      prepend(this.lens, this.overlayContainer)
      append(this.lensImage, this.lens)

      append(this.overlayContainer, this.container)
    }
    this.initPositon()
    const offset = this.getElementOffset()
    this.lastOffset = JSON.stringify(offset)
    this.bind()
  }
github pluginjs / pluginjs / modules / masonry / src / components / toolbar.js View on Github external
classes: this.classes
        }
      )
    }

    this.toolbar = templateEngine.render(
      this.instance.options.templates.toolbar.call(this),
      {
        classes: this.classes,
        filters: this.filters,
        sort: this.sort,
        reverse: this.reverse
      }
    )

    prepend(this.toolbar, this.instance.element)

    this.handleFilters()
    this.handleSort()
    this.handleReverse()
  }