1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-10 15:44:51 +02:00
This commit is contained in:
XhmikosR
2020-05-13 21:53:43 +03:00
committed by GitHub
parent 53eb7d3883
commit de7af5ee07
56 changed files with 3476 additions and 4263 deletions

29
js/dist/carousel.js vendored
View File

@@ -213,10 +213,8 @@
var DATA_KEY = 'bs.carousel';
var EVENT_KEY = "." + DATA_KEY;
var DATA_API_KEY = '.data-api';
var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key
var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key
var ARROW_LEFT_KEY = 'ArrowLeft';
var ARROW_RIGHT_KEY = 'ArrowRight';
var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
var SWIPE_THRESHOLD = 40;
@@ -293,7 +291,7 @@
this._element = element;
this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element);
this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent);
this._pointerEvent = Boolean(window.PointerEvent);
this._addEventListeners();
@@ -397,7 +395,7 @@
;
_proto._getConfig = function _getConfig(config) {
config = _objectSpread2({}, Default, {}, config);
config = _objectSpread2(_objectSpread2({}, Default), config);
typeCheckConfig(NAME, config, DefaultType);
return config;
};
@@ -525,13 +523,13 @@
return;
}
switch (event.which) {
case ARROW_LEFT_KEYCODE:
switch (event.key) {
case ARROW_LEFT_KEY:
event.preventDefault();
this.prev();
break;
case ARROW_RIGHT_KEYCODE:
case ARROW_RIGHT_KEY:
event.preventDefault();
this.next();
break;
@@ -656,12 +654,9 @@
var transitionDuration = getTransitionDurationFromElement(activeElement);
EventHandler.one(activeElement, TRANSITION_END, function () {
nextElement.classList.remove(directionalClassName);
nextElement.classList.remove(orderClassName);
nextElement.classList.remove(directionalClassName, orderClassName);
nextElement.classList.add(CLASS_NAME_ACTIVE);
activeElement.classList.remove(CLASS_NAME_ACTIVE);
activeElement.classList.remove(orderClassName);
activeElement.classList.remove(directionalClassName);
activeElement.classList.remove(CLASS_NAME_ACTIVE, orderClassName, directionalClassName);
_this4._isSliding = false;
setTimeout(function () {
EventHandler.trigger(_this4._element, EVENT_SLID, {
@@ -694,10 +689,10 @@
Carousel.carouselInterface = function carouselInterface(element, config) {
var data = Data.getData(element, DATA_KEY);
var _config = _objectSpread2({}, Default, {}, Manipulator.getDataAttributes(element));
var _config = _objectSpread2(_objectSpread2({}, Default), Manipulator.getDataAttributes(element));
if (typeof config === 'object') {
_config = _objectSpread2({}, _config, {}, config);
_config = _objectSpread2(_objectSpread2({}, _config), config);
}
var action = typeof config === 'string' ? config : _config.slide;
@@ -733,7 +728,7 @@
return;
}
var config = _objectSpread2({}, Manipulator.getDataAttributes(target), {}, Manipulator.getDataAttributes(this));
var config = _objectSpread2(_objectSpread2({}, Manipulator.getDataAttributes(target)), Manipulator.getDataAttributes(this));
var slideIndex = this.getAttribute('data-slide-to');