Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap-rubygem.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Mazovetskiy <glex.spb@gmail.com>2015-10-18 20:58:40 +0300
committerGleb Mazovetskiy <glex.spb@gmail.com>2015-10-18 20:58:40 +0300
commita83988ed4257ffd83f5734868efb6cf9b1ca3296 (patch)
treec3523256cb7835576f420e0c0604da1fa25a370f /assets/javascripts/bootstrap
parent357ce5cb41b4d6a5dabe76e294e29380c47c7783 (diff)
rake update[v4-dev]
Diffstat (limited to 'assets/javascripts/bootstrap')
-rw-r--r--assets/javascripts/bootstrap/carousel.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/assets/javascripts/bootstrap/carousel.js b/assets/javascripts/bootstrap/carousel.js
index 880ac45..ea99cad 100644
--- a/assets/javascripts/bootstrap/carousel.js
+++ b/assets/javascripts/bootstrap/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);
}
}
}, {