]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Prevent empty carousel from throwing, and staying in a 'sliding' state. 24592/head 24641/head 24792/head 24818/head 25328/head 26274/head 26481/head 26550/head 26554/head 26590/head 27205/head 32893/head
authorCraig Main <craig@palantir.co.za>
Wed, 4 Oct 2017 07:50:46 +0000 (10:50 +0300)
committerXhmikosR <xhmikosr@gmail.com>
Wed, 4 Oct 2017 07:51:34 +0000 (10:51 +0300)
Fixes #24132.

js/carousel.js

index 6ff954c9bde09acb4e93cc0d2df707e75848d67a..2091bc351dd779f52b8b114ae5da3b2188774d6a 100644 (file)
     var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
     if ($.support.transition && this.$element.hasClass('slide')) {
       $next.addClass(type)
-      $next[0].offsetWidth // force reflow
+      if (typeof $next === 'object' && $next.length) {
+        $next[0].offsetWidth // force reflow
+      }
       $active.addClass(direction)
       $next.addClass(direction)
       $active