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
card-mod-bootstrap-0.18.1 vendor/bootswatch/docs/3/bower_components/bootstrap-sass-official/assets/javascripts/bootstrap/transition.js
card-mod-bootstrap-0.18.1 vendor/bootswatch/docs/3/bower_components/bootstrap/js/transition.js
card-mod-bootstrap-0.18.0 vendor/bootswatch/docs/3/bower_components/bootstrap/js/transition.js
card-mod-bootstrap-0.18.0 vendor/bootswatch/docs/3/bower_components/bootstrap-sass-official/assets/javascripts/bootstrap/transition.js
rails_admin-2.3.1 vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-transition.js
rails_admin-2.3.0 vendor/assets/javascripts/rails_admin/bootstrap/bootstrap-transition.js
publify_core-10.0.2 app/assets/javascripts/bootstrap/transition.js
card-mod-bootstrap-0.17.0 vendor/bootswatch/docs/3/bower_components/bootstrap/js/transition.js
card-mod-bootstrap-0.17.0 vendor/bootswatch/docs/3/bower_components/bootstrap-sass-official/assets/javascripts/bootstrap/transition.js
HornsAndHooves-publify_core-10.5.0 app/assets/javascripts/bootstrap/transition.js
HornsAndHooves-publify_core-10.4.0 app/assets/javascripts/bootstrap/transition.js
HornsAndHooves-publify_core-10.3.0 app/assets/javascripts/bootstrap/transition.js
HornsAndHooves-publify_core-10.2.0 app/assets/javascripts/bootstrap/transition.js
card-mod-bootstrap-0.16.0 vendor/bootswatch/docs/3/bower_components/bootstrap-sass-official/assets/javascripts/bootstrap/transition.js
card-mod-bootstrap-0.16.0 vendor/bootswatch/docs/3/bower_components/bootstrap/js/transition.js
publify_core-10.0.1 app/assets/javascripts/bootstrap/transition.js
publify_core-10.0.0 app/assets/javascripts/bootstrap/transition.js
card-mod-bootstrap-0.15.6 vendor/bootswatch/docs/3/bower_components/bootstrap/js/transition.js
card-mod-bootstrap-0.15.6 vendor/bootswatch/docs/3/bower_components/bootstrap-sass-official/assets/javascripts/bootstrap/transition.js
card-mod-bootstrap-0.15.5 vendor/bootswatch/docs/3/bower_components/bootstrap/js/transition.js