Sha256: 1b312719d3fcf8ba84632630bfb857b7e2136053ade7e2bd2c49e1f46fc54f9f

Contents?: true

Size: 1.1 KB

Versions: 2

Compression:

Stored size: 1.1 KB

Contents

(function ($, window, document, undefined) {
  'use strict';

  $.fn.animateCSS = function (effect, delay, callback) {
    return this.each(function () {

      var $this       = $(this),
        animated      = "animated animated-",
        hidden        = "hidden",
        transitionEnd = "webkitAnimationEnd oanimationend msAnimationEnd animationend",
        visibility    = "visibility",
        visible       = "visible";

      function run() {
        $this.addClass( animated + " " + effect)

        if ($this.css( visibility ) === hidden) {
          $this.css( visibility, visible)
        }

        if ($this.is(":" + hidden)) {
          $this.show()
        }

        $this.bind( transitionEnd, function () {
          $this.removeClass(animated + " " + effect)

          if (typeof callback === "function") {
            callback.call(this)
            $this.unbind( transitionEnd )
          }
        })
      }

      if (!delay || typeof delay === "function") {
        callback = delay;
        run()
      } else {
        setTimeout(run, delay)
      }

    })
  }

})(jQuery, window, document);

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
active_frontend-11.1.0 vendor/assets/javascripts/_animation.js
active_frontend-11.0.0 vendor/assets/javascripts/_animation.js