diff options
author | XhmikosR <xhmikosr@gmail.com> | 2020-05-13 21:53:43 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-13 21:53:43 +0300 |
commit | de7af5ee0738d08ef2d6702654834beb5bfce35e (patch) | |
tree | 371b751a7f96f96399e53d1767b8f0c4610cb268 /js/dist/carousel.js | |
parent | 53eb7d38830f1e7c593069c8f5b40f4127563317 (diff) |
Dist (#30694)
Diffstat (limited to 'js/dist/carousel.js')
-rw-r--r-- | js/dist/carousel.js | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/js/dist/carousel.js b/js/dist/carousel.js index 70b4d86bec..2c57158d82 100644 --- a/js/dist/carousel.js +++ b/js/dist/carousel.js @@ -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'); |