diff options
Diffstat (limited to 'assets/javascripts/bootstrap/carousel.js')
-rw-r--r-- | assets/javascripts/bootstrap/carousel.js | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/assets/javascripts/bootstrap/carousel.js b/assets/javascripts/bootstrap/carousel.js index f5dd28c..8326699 100644 --- a/assets/javascripts/bootstrap/carousel.js +++ b/assets/javascripts/bootstrap/carousel.js @@ -1,4 +1,6 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } @@ -6,7 +8,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d /** * -------------------------------------------------------------------------- - * Bootstrap (v4.0.0): carousel.js + * Bootstrap (v4.1.0): carousel.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * -------------------------------------------------------------------------- */ @@ -17,12 +19,11 @@ var Carousel = function ($) { * ------------------------------------------------------------------------ */ var NAME = 'carousel'; - var VERSION = '4.0.0'; + var VERSION = '4.1.0'; var DATA_KEY = 'bs.carousel'; var EVENT_KEY = "." + DATA_KEY; var DATA_API_KEY = '.data-api'; var JQUERY_NO_CONFLICT = $.fn[NAME]; - var TRANSITION_DURATION = 600; var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key @@ -131,7 +132,7 @@ var Carousel = function ($) { this._isPaused = true; } - if ($(this._element).find(Selector.NEXT_PREV)[0] && Util.supportsTransitionEnd()) { + if ($(this._element).find(Selector.NEXT_PREV)[0]) { Util.triggerTransitionEnd(this._element); this.cycle(true); } @@ -199,7 +200,7 @@ var Carousel = function ($) { _proto._getConfig = function _getConfig(config) { - config = _extends({}, Default, config); + config = _objectSpread({}, Default, config); Util.typeCheckConfig(NAME, config, DefaultType); return config; }; @@ -370,11 +371,12 @@ var Carousel = function ($) { to: nextElementIndex }); - if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.SLIDE)) { + if ($(this._element).hasClass(ClassName.SLIDE)) { $(nextElement).addClass(orderClassName); Util.reflow(nextElement); $(activeElement).addClass(directionalClassName); $(nextElement).addClass(directionalClassName); + var transitionDuration = Util.getTransitionDurationFromElement(activeElement); $(activeElement).one(Util.TRANSITION_END, function () { $(nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(ClassName.ACTIVE); $(activeElement).removeClass(ClassName.ACTIVE + " " + orderClassName + " " + directionalClassName); @@ -382,7 +384,7 @@ var Carousel = function ($) { setTimeout(function () { return $(_this3._element).trigger(slidEvent); }, 0); - }).emulateTransitionEnd(TRANSITION_DURATION); + }).emulateTransitionEnd(transitionDuration); } else { $(activeElement).removeClass(ClassName.ACTIVE); $(nextElement).addClass(ClassName.ACTIVE); @@ -400,10 +402,10 @@ var Carousel = function ($) { return this.each(function () { var data = $(this).data(DATA_KEY); - var _config = _extends({}, Default, $(this).data()); + var _config = _objectSpread({}, Default, $(this).data()); if (typeof config === 'object') { - _config = _extends({}, _config, config); + _config = _objectSpread({}, _config, config); } var action = typeof config === 'string' ? config : _config.slide; @@ -441,7 +443,7 @@ var Carousel = function ($) { return; } - var config = _extends({}, $(target).data(), $(this).data()); + var config = _objectSpread({}, $(target).data(), $(this).data()); var slideIndex = this.getAttribute('data-slide-to'); |