Add comments in carousel.js to clarify that "slid" is not a typo
Addresses #13248.
This commit is contained in:
parent
158b491f26
commit
26f6807a3d
|
@ -59,7 +59,7 @@
|
|||
|
||||
if (pos > (this.$items.length - 1) || pos < 0) return
|
||||
|
||||
if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) })
|
||||
if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid". not a typo. past tense of "to slide".
|
||||
if (activeIndex == pos) return this.pause().cycle()
|
||||
|
||||
return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
|
||||
|
@ -113,7 +113,7 @@
|
|||
|
||||
if (this.$indicators.length) {
|
||||
this.$indicators.find('.active').removeClass('active')
|
||||
this.$element.one('slid.bs.carousel', function () {
|
||||
this.$element.one('slid.bs.carousel', function () { // yes, "slid". not a typo. past tense of "to slide".
|
||||
var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
|
||||
$nextIndicator && $nextIndicator.addClass('active')
|
||||
})
|
||||
|
@ -129,14 +129,14 @@
|
|||
$next.removeClass([type, direction].join(' ')).addClass('active')
|
||||
$active.removeClass(['active', direction].join(' '))
|
||||
that.sliding = false
|
||||
setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0)
|
||||
setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0) // yes, "slid". not a typo. past tense of "to slide".
|
||||
})
|
||||
.emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000)
|
||||
} else {
|
||||
$active.removeClass('active')
|
||||
$next.addClass('active')
|
||||
this.sliding = false
|
||||
this.$element.trigger('slid.bs.carousel')
|
||||
this.$element.trigger('slid.bs.carousel') // yes, "slid". not a typo. past tense of "to slide".
|
||||
}
|
||||
|
||||
isCycling && this.cycle()
|
||||
|
|
Loading…
Reference in New Issue