diff options
author | GeoSot <geo.sotis@gmail.com> | 2022-03-02 03:18:55 +0300 |
---|---|---|
committer | XhmikosR <xhmikosr@gmail.com> | 2022-03-09 18:25:47 +0300 |
commit | 7e5a8016ba557641ee93b38aed4482a1360b64af (patch) | |
tree | b44da950762dcfb2a58348e216ea5eaee41e7f75 | |
parent | d4e87d28cdc1b5d053b4c08da737321ab4de2ff7 (diff) |
Carousel: return early in `_slide` method
-rw-r--r-- | js/src/carousel.js | 8 |
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 => { |