aboutsummaryrefslogtreecommitdiff
path: root/js/src
diff options
context:
space:
mode:
authorJohann-S <[email protected]>2017-08-17 17:44:09 +0200
committerJohann-S <[email protected]>2017-08-17 17:48:14 +0100
commit58b54b6c15543dce3aca90e202037fa3b194f72e (patch)
tree6b3b0ac8d0c74a6ade4c8961b00e3e4f8b7e1a71 /js/src
parenta77f515a2228a11ae5815a76b7f3ba3b3bd17f1e (diff)
downloadbootstrap-58b54b6c15543dce3aca90e202037fa3b194f72e.tar.xz
bootstrap-58b54b6c15543dce3aca90e202037fa3b194f72e.zip
Carousel - do not call next when the carousel or the parent isn't visible
Diffstat (limited to 'js/src')
-rw-r--r--js/src/carousel.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/js/src/carousel.js b/js/src/carousel.js
index a5d5f143a..27a8f7d3b 100644
--- a/js/src/carousel.js
+++ b/js/src/carousel.js
@@ -131,7 +131,9 @@ const Carousel = (($) => {
nextWhenVisible() {
// Don't call next when the page isn't visible
- if (!document.hidden) {
+ // or the carousel or it's parent isn't visible
+ if (!document.hidden &&
+ ($(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden')) {
this.next()
}
}