0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-01-17 09:52:29 +01:00

Prevent empty carousel from throwing, and staying in a 'sliding' state.

Fixes #24132.
This commit is contained in:
Craig Main 2017-10-04 10:50:46 +03:00 committed by XhmikosR
parent e52df5dce5
commit 2c2ac33564

View File

@ -144,7 +144,9 @@
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