]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Carousel - do not call next when the carousel or the parent isn't visible
authorJohann-S <johann.servoire@gmail.com>
Thu, 17 Aug 2017 15:44:09 +0000 (17:44 +0200)
committerJohann-S <johann.servoire@gmail.com>
Thu, 17 Aug 2017 16:48:14 +0000 (17:48 +0100)
js/src/carousel.js

index a5d5f143a497edfc5bf64e023820e93a9715641a..27a8f7d3b82d4a072a911fdd7559015813452c9e 100644 (file)
@@ -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()
       }
     }