Sha256: f22eb1ef51e3b2dcff57551a8d165c148ed17dce8a86a8730a22587e553367ad

Contents?: true

Size: 1.36 KB

Versions: 191

Compression:

Stored size: 1.36 KB

Contents

+function ($) {
  'use strict';

  // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
  // ============================================================

  function transitionEnd() {
    var el = document.createElement('bootstrap')

    var transEndEventNames = {
      WebkitTransition : 'webkitTransitionEnd',
      MozTransition    : 'transitionend',
      OTransition      : 'oTransitionEnd otransitionend',
      transition       : 'transitionend'
    }

    for (var name in transEndEventNames) {
      if (el.style[name] !== undefined) {
        return { end: transEndEventNames[name] }
      }
    }

    return false // explicit for ie8 (  ._.)
  }

  // http://blog.alexmaccaw.com/css-transitions
  $.fn.emulateTransitionEnd = function (duration) {
    var called = false
    var $el = this
    $(this).one('bsTransitionEnd', function () { called = true })
    var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
    setTimeout(callback, duration)
    return this
  }

  $(function () {
    $.support.transition = transitionEnd()

    if (!$.support.transition) return

    $.event.special.bsTransitionEnd = {
      bindType: $.support.transition.end,
      delegateType: $.support.transition.end,
      handle: function (e) {
        if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
      }
    }
  })

}(jQuery);

Version data entries

191 entries across 191 versions & 2 rubygems

Version Path
active_frontend-7.0.2 vendor/assets/javascripts/transition.js
active_frontend-7.0.1 vendor/assets/javascripts/transition.js
active_frontend-7.0.0 vendor/assets/javascripts/transition.js
active_frontend-6.6.2 vendor/assets/javascripts/transition.js
active_frontend-6.6.1 vendor/assets/javascripts/transition.js
active_frontend-6.6.0 vendor/assets/javascripts/transition.js
active_frontend-6.5.0 vendor/assets/javascripts/transition.js
active_frontend-6.4.2 vendor/assets/javascripts/transition.js
active_frontend-6.4.1 vendor/assets/javascripts/transition.js
active_frontend-6.4.0 vendor/assets/javascripts/transition.js
active_frontend-6.3.2 vendor/assets/javascripts/transition.js
active_frontend-6.3.1 vendor/assets/javascripts/transition.js
active_frontend-6.3.0 vendor/assets/javascripts/transition.js
active_frontend-6.2.0 vendor/assets/javascripts/transition.js
active_frontend-6.1.0 vendor/assets/javascripts/transition.js
active_frontend-6.0.0 vendor/assets/javascripts/transition.js
active_frontend-5.0.1 vendor/assets/javascripts/transition.js
active_frontend-5.0.0 vendor/assets/javascripts/transition.js
active_frontend-4.5.1 vendor/assets/javascripts/transition.js
active_frontend-4.5.0 vendor/assets/javascripts/transition.js