mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-05 16:42:29 +03:00
[V4] Throw error when a plugin is in transition (#17823)
* Throw error when a plugin is in transition * Add unit tests about plugins in transition
This commit is contained in:
+6
-4
@@ -116,9 +116,10 @@ const Carousel = (($) => {
|
||||
// public
|
||||
|
||||
next() {
|
||||
if (!this._isSliding) {
|
||||
this._slide(Direction.NEXT)
|
||||
if (this._isSliding) {
|
||||
throw new Error('Carousel is sliding')
|
||||
}
|
||||
this._slide(Direction.NEXT)
|
||||
}
|
||||
|
||||
nextWhenVisible() {
|
||||
@@ -129,9 +130,10 @@ const Carousel = (($) => {
|
||||
}
|
||||
|
||||
prev() {
|
||||
if (!this._isSliding) {
|
||||
this._slide(Direction.PREVIOUS)
|
||||
if (this._isSliding) {
|
||||
throw new Error('Carousel is sliding')
|
||||
}
|
||||
this._slide(Direction.PREVIOUS)
|
||||
}
|
||||
|
||||
pause(event) {
|
||||
|
||||
Reference in New Issue
Block a user