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:
Diffstat (limited to 'js/src/carousel.js')
-rw-r--r--js/src/carousel.js16
1 files changed, 9 insertions, 7 deletions
diff --git a/js/src/carousel.js b/js/src/carousel.js
index e91ba376c1..51c5dded8e 100644
--- a/js/src/carousel.js
+++ b/js/src/carousel.js
@@ -148,8 +148,7 @@ class Carousel extends BaseComponent {
this.cycle(true)
}
- clearInterval(this._interval)
- this._interval = null
+ this._clearInterval()
}
cycle(event) {
@@ -157,11 +156,7 @@ class Carousel extends BaseComponent {
this._isPaused = false
}
- if (this._interval) {
- clearInterval(this._interval)
- this._interval = null
- }
-
+ this._clearInterval()
if (this._config.interval && !this._isPaused) {
this._updateInterval()
@@ -412,6 +407,13 @@ class Carousel extends BaseComponent {
return SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element)
}
+ _clearInterval() {
+ if (this._interval) {
+ clearInterval(this._interval)
+ this._interval = null
+ }
+ }
+
_directionToOrder(direction) {
if (![DIRECTION_RIGHT, DIRECTION_LEFT].includes(direction)) {
return direction