Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoSot <geo.sotis@gmail.com>2022-03-02 03:18:55 +0300
committerXhmikosR <xhmikosr@gmail.com>2022-03-09 18:25:47 +0300
commit7e5a8016ba557641ee93b38aed4482a1360b64af (patch)
treeb44da950762dcfb2a58348e216ea5eaee41e7f75 /js/src/carousel.js
parentd4e87d28cdc1b5d053b4c08da737321ab4de2ff7 (diff)
Carousel: return early in `_slide` method
Diffstat (limited to 'js/src/carousel.js')
-rw-r--r--js/src/carousel.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/js/src/carousel.js b/js/src/carousel.js
index f37ded7c24..f5917eb7f4 100644
--- a/js/src/carousel.js
+++ b/js/src/carousel.js
@@ -297,6 +297,10 @@ class Carousel extends BaseComponent {
}
_slide(order, element = null) {
+ if (this._isSliding) {
+ return
+ }
+
const activeElement = this._getActive()
const isNext = order === ORDER_NEXT
const nextElement = element || getNextActiveElement(this._getItems(), activeElement, isNext, this._config.wrap)
@@ -305,10 +309,6 @@ class Carousel extends BaseComponent {
return
}
- if (this._isSliding) {
- return
- }
-
const nextElementIndex = this._getItemIndex(nextElement)
const triggerEvent = eventName => {