mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-12 09:54:25 +01:00
Carousel: merge slide functionality, regardless of whether it is animated or not
This commit is contained in:
parent
a247fe9b27
commit
d97125475b
@ -372,7 +372,6 @@ class Carousel extends BaseComponent {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._element.classList.contains(CLASS_NAME_SLIDE)) {
|
|
||||||
nextElement.classList.add(orderClassName)
|
nextElement.classList.add(orderClassName)
|
||||||
|
|
||||||
reflow(nextElement)
|
reflow(nextElement)
|
||||||
@ -391,20 +390,17 @@ class Carousel extends BaseComponent {
|
|||||||
setTimeout(triggerSlidEvent, 0)
|
setTimeout(triggerSlidEvent, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
this._queueCallback(completeCallBack, activeElement, true)
|
this._queueCallback(completeCallBack, activeElement, this._isAnimated())
|
||||||
} else {
|
|
||||||
activeElement.classList.remove(CLASS_NAME_ACTIVE)
|
|
||||||
nextElement.classList.add(CLASS_NAME_ACTIVE)
|
|
||||||
|
|
||||||
this._isSliding = false
|
|
||||||
triggerSlidEvent()
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isCycling) {
|
if (isCycling) {
|
||||||
this.cycle()
|
this.cycle()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_isAnimated() {
|
||||||
|
return this._element.classList.contains(CLASS_NAME_SLIDE)
|
||||||
|
}
|
||||||
|
|
||||||
_getActive() {
|
_getActive() {
|
||||||
return SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element)
|
return SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user