2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-05-27 14:46:01 +03: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
+3 -1
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