diff options
author | XhmikosR <xhmikosr@gmail.com> | 2015-10-14 00:49:31 +0300 |
---|---|---|
committer | XhmikosR <xhmikosr@gmail.com> | 2015-10-14 00:49:31 +0300 |
commit | 724bf862885f57383f3a19ed46a6deab0f2322a6 (patch) | |
tree | b64933a1124e9612fa38c84f68f673a96e7b72c2 /js/dist/carousel.js | |
parent | fe0ad8215982bb5dad794f4e954dfa36550d787e (diff) |
Run `grunt`.
[ci skip]
Diffstat (limited to 'js/dist/carousel.js')
-rw-r--r-- | js/dist/carousel.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/js/dist/carousel.js b/js/dist/carousel.js index 880ac451fd..ea99cade21 100644 --- a/js/dist/carousel.js +++ b/js/dist/carousel.js @@ -120,6 +120,14 @@ var Carousel = (function ($) { } } }, { + key: 'nextWhenVisible', + value: function nextWhenVisible() { + // Don't call next when the page isn't visible + if (!document.hidden) { + this.next(); + } + } + }, { key: 'prev', value: function prev() { if (!this._isSliding) { @@ -154,7 +162,7 @@ var Carousel = (function ($) { } if (this._config.interval && !this._isPaused) { - this._interval = setInterval($.proxy(this.next, this), this._config.interval); + this._interval = setInterval($.proxy(document.visibilityState ? this.nextWhenVisible : this.next, this), this._config.interval); } } }, { |