Sha256: dfd38a036a1ed2f6362413696c71555c108aa06b2ffef68577705df1b1983bc2

Contents?: true

Size: 1.8 KB

Versions: 136

Compression:

Stored size: 1.8 KB

Contents

/* ========================================================================
 * Bootstrap: transition.js v3.4.1
 * https://getbootstrap.com/docs/3.4/javascript/#transitions
 * ========================================================================
 * Copyright 2011-2019 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * ======================================================================== */


+function ($) {
  'use strict';

  // CSS TRANSITION SUPPORT (Shoutout: https://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 (  ._.)
  }

  // https://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

136 entries across 93 versions & 9 rubygems

Version Path
twbs_sass_rails-8.0.0 vendor/assets/javascripts/twbs/bootstrap/transition.js
card-1.98.2 mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/js/transition.js
card-1.98.2 mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap-sass-official/assets/javascripts/bootstrap/transition.js
zuora_connect_ui-0.8.1 vendor/ruby/2.6.0/gems/bootstrap-sass-3.4.1/assets/javascripts/bootstrap/transition.js
zuora_connect_ui-0.8.0 vendor/ruby/2.6.0/gems/bootstrap-sass-3.4.1/assets/javascripts/bootstrap/transition.js
card-1.98.1 mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/js/transition.js
card-1.98.1 mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap-sass-official/assets/javascripts/bootstrap/transition.js
card-1.98.0 mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap-sass-official/assets/javascripts/bootstrap/transition.js
card-1.98.0 mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/js/transition.js
zuora_connect_ui-0.7.1 vendor/ruby/2.6.0/gems/bootstrap-sass-3.4.1/assets/javascripts/bootstrap/transition.js
zuora_connect_ui-0.7.0 vendor/ruby/2.6.0/gems/bootstrap-sass-3.4.1/assets/javascripts/bootstrap/transition.js
twbs_sass_rails-7.2.0 vendor/assets/javascripts/twbs/bootstrap/transition.js
card-1.97.0.1 mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap-sass-official/assets/javascripts/bootstrap/transition.js
card-1.97.0.1 mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/js/transition.js
twbs_sass_rails-7.1.0 vendor/assets/javascripts/twbs/bootstrap/transition.js
bootstrap-sass-3.4.1 assets/javascripts/bootstrap/transition.js