How to use holderjs - 4 common examples

To help you get started, we’ve selected a few holderjs 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 StreetSupport / streetsupport-web / src / js / page-give-requests.js View on Github external
var cardCallback = function () {
      document.querySelector('.js-card-detail').classList.remove('is-hidden')
      document.querySelector('.js-card-detail').classList.add('is-active')

      window.scrollTo(0, 0)

      Holder.run({})

      // TODO: Proper URL support
      var state = { test: 'TBA' }
      history.pushState(state, 'TEST', '?id=' + theId)

      var d
      var cardBack = document.querySelectorAll('.js-card-back')

      // Add click listener to each item
      for (d = 0; d < cardBack.length; d++) {
        cardBack[d].addEventListener('click', function (event) {
          event.preventDefault()
          cardBackOnClick()
        })
      }
github webkom-co / airframe-next / components / HolderProvider / HolderTextProvider.js View on Github external
initPlaceholder() {
        if (
            typeof window !== 'undefined' &&
            typeof document !== 'undefined' &&
            document.readyState === 'complete'
        ) {
            const Holder = require('holderjs');
            const domElement = document.getElementById(this.domId);

            if (domElement) {
                Holder.run({
                    domain: 'holder.js',
                    images: domElement,
                    object: null,
                    bgnodes: null,
                    stylenodes: null
                })

                return true;
            }
        }

        return false;
    }
github TerryZ / vue-plugins / src / components / v-uploader / Uploader.vue View on Github external
mounted(){
            let that = this;

            if(!this.multiple) {
                if(this.preview && !this.previewImg) holder.run({ images: this.$refs.simpleImg });
                this.options.button = this.$refs.upload;
                //upload error callback
                //basic mode work only
                that.options.callbacks.onError = (id, name, errorReason, xhr) => {
                    if(that.showMessage && typeof that.showMessage === 'function')
                        that.showMessage(that, errorReason);
                };
                if(this.beforeUpload && typeof this.beforeUpload === 'function')
                    that.options.callbacks.onSubmit = this.beforeUpload;
                new fu.FineUploaderBasic(that.options);
            }else{
                that.options.deleteFile.endpoint = this.deleteFileUrl;
                that.options.template = this.$refs.uploadArea;
                that.options.element = this.$refs.multipleUpload;
                that.options.showMessage = message => {
                    if(that.showMessage && typeof that.showMessage === 'function') that.showMessage(that, message);

holderjs

Holder uses SVG to render image placeholders entirely in browser.

MIT
Latest version published 4 years ago

Package Health Score

56 / 100
Full package analysis

Popular holderjs functions