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
path: root/js
diff options
context:
space:
mode:
authorGeoSot <geo.sotis@gmail.com>2021-09-10 02:13:58 +0300
committerXhmikosR <xhmikosr@gmail.com>2021-12-21 18:37:24 +0300
commitb8ee68cfa0f3516dc55aec5da6d7e43e2705f402 (patch)
treec00dfaadd685d9bead81bf6aa636ac2f4ee2da4d /js
parentff4bf4a458d1bfab6a3cb8803e762fdb0de8bc3e (diff)
Carousel: remove always true `visibilityState` check
According to https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilityState `visibilityState` is always a string, so the check was always true
Diffstat (limited to 'js')
-rw-r--r--js/src/carousel.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/js/src/carousel.js b/js/src/carousel.js
index 336bcd261a..e91ba376c1 100644
--- a/js/src/carousel.js
+++ b/js/src/carousel.js
@@ -126,6 +126,7 @@ class Carousel extends BaseComponent {
}
nextWhenVisible() {
+ // FIXME TODO use `document.visibilityState`
// Don't call next when the page isn't visible
// or the carousel or its parent isn't visible
if (!document.hidden && isVisible(this._element)) {
@@ -164,10 +165,7 @@ class Carousel extends BaseComponent {
if (this._config.interval && !this._isPaused) {
this._updateInterval()
- this._interval = setInterval(
- (document.visibilityState ? this.nextWhenVisible : this.next).bind(this),
- this._config.interval
- )
+ this._interval = setInterval(() => this.nextWhenVisible(), this._config.interval)
}
}