diff options
author | GeoSot <geo.sotis@gmail.com> | 2021-09-10 02:13:58 +0300 |
---|---|---|
committer | XhmikosR <xhmikosr@gmail.com> | 2021-12-21 18:37:24 +0300 |
commit | b8ee68cfa0f3516dc55aec5da6d7e43e2705f402 (patch) | |
tree | c00dfaadd685d9bead81bf6aa636ac2f4ee2da4d /js/src | |
parent | ff4bf4a458d1bfab6a3cb8803e762fdb0de8bc3e (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/src')
-rw-r--r-- | js/src/carousel.js | 6 |
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) } } |