1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-26 21:39:08 +02: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:
Johann
2016-12-02 18:52:19 +01:00
committed by Mark Otto
parent 1fb6d8c46a
commit 297c47c3fd
8 changed files with 144 additions and 23 deletions

View File

@@ -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) {