How to use the @pluginjs/utils.each function in @pluginjs/utils

To help you get started, we’ve selected a few @pluginjs/utils 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 / icon-picker / src / main.js View on Github external
const $pack = parseHTML(
      this.packTemplate({
        classes: this.classes,
        pack
      })
    )

    pack.__dom = $pack
    pack.__items = {}

    if (pack.classifiable === false) {
      each(pack.icons, (name, label) => {
        $pack.appendChild(this.buildItem(pack, name, label))
      })
    } else {
      each(pack.categories, (category, icons) => {
        $pack.appendChild(this.buildGroup(pack, category, icons))
      })
    }

    this.$main.appendChild($pack)

    return $pack
  }
github pluginjs / pluginjs / modules / icon-picker / src / main.js View on Github external
this.options.templates.pack.call(this)
      )
    }

    const $pack = parseHTML(
      this.packTemplate({
        classes: this.classes,
        pack
      })
    )

    pack.__dom = $pack
    pack.__items = {}

    if (pack.classifiable === false) {
      each(pack.icons, (name, label) => {
        $pack.appendChild(this.buildItem(pack, name, label))
      })
    } else {
      each(pack.categories, (category, icons) => {
        $pack.appendChild(this.buildGroup(pack, category, icons))
      })
    }

    this.$main.appendChild($pack)

    return $pack
  }
github pluginjs / pluginjs / modules / icon-picker / src / main.js View on Github external
const $pack = parseHTML(
      this.packTemplate({
        classes: this.classes,
        pack
      })
    )

    pack.__dom = $pack
    pack.__items = {}

    if (pack.classifiable === false) {
      each(pack.icons, (name, label) => {
        $pack.appendChild(this.buildItem(pack, name, label))
      })
    } else {
      each(pack.categories, (category, icons) => {
        $pack.appendChild(this.buildGroup(pack, category, icons))
      })
    }

    this.$main.appendChild($pack)

    return $pack
  }
github pluginjs / pluginjs / modules / breakpoints / src / main.js View on Github external
destroy() {
    each(sizes, (name, size) => {
      size.destroy()
    })
    sizes = {}
    viewports = {}
    ChangeEvent.current = null
  },
github pluginjs / pluginjs / modules / wizard / src / main.js View on Github external
initialize() {
    if (this.options.theme) {
      addClass(this.getThemeClass(), this.element)
    }

    this.steps = []
    const that = this

    each(this.$steps, (element, index) => {
      that.steps.push(new Step(element, that, index))
    })

    this.present = 0
    this.transitioning = null

    each(this.steps, step => {
      step.setup()
    })

    this.setup()

    this.bind()

    if (this.options.keyboard) {
      this.KEYBOARD = new Keyboard(this)
    }
    this.enter('initialized')
    this.trigger(EVENTS.READY)
  }
github pluginjs / pluginjs / modules / video / src / source / html5.js View on Github external
unbind() {
    each(this.listeners, (event, listener) => {
      this.$player.removeEventListener(event, listener)
    })
  }
github pluginjs / pluginjs / modules / font-picker / src / main.js View on Github external
if (isArray(source.fonts)) {
      source.fonts.forEach(font => {
        $source.appendChild(this.buildItem(source, font))
      })
    } else if (isObject(source.fonts)) {
      each(source.fonts, (category, fonts) => {
        $source.appendChild(this.buildGroup(source, category, fonts))
      })
    }

    this.$main.appendChild($source)

    if (isArray(source.fonts)) {
      this.FONTLOADER.observe(source.__items)
    } else if (isObject(source.fonts)) {
      each(source.__items, (k, group) => {
        this.FONTLOADER.observe(group.items)
      })
    }

    return $source
  }
github pluginjs / pluginjs / modules / font-picker / src / main.js View on Github external
const $source = parseHTML(
      this.sourceTemplate({
        classes: this.classes,
        source
      })
    )

    source.__dom = $source
    source.__items = {}

    if (isArray(source.fonts)) {
      source.fonts.forEach(font => {
        $source.appendChild(this.buildItem(source, font))
      })
    } else if (isObject(source.fonts)) {
      each(source.fonts, (category, fonts) => {
        $source.appendChild(this.buildGroup(source, category, fonts))
      })
    }

    this.$main.appendChild($source)

    if (isArray(source.fonts)) {
      this.FONTLOADER.observe(source.__items)
    } else if (isObject(source.fonts)) {
      each(source.__items, (k, group) => {
        this.FONTLOADER.observe(group.items)
      })
    }

    return $source
  }