diff options
| author | Pierre Vanduynslager <[email protected]> | 2017-03-28 17:43:16 -0400 |
|---|---|---|
| committer | Johann-S <[email protected]> | 2017-03-28 23:43:15 +0200 |
| commit | 48c5efa4c3c439d8720b8475ec3e372c6974a12a (patch) | |
| tree | 927c262f444f4aaeb0f598cf35ab7b1b385ae76a /js/src/carousel.js | |
| parent | ce0e2f8e76dade4b6ec9d6eb541c6988739f0653 (diff) | |
| download | bootstrap-48c5efa4c3c439d8720b8475ec3e372c6974a12a.tar.xz bootstrap-48c5efa4c3c439d8720b8475ec3e372c6974a12a.zip | |
Fix JS components console error "Error: <Component> is transitioning"
Diffstat (limited to 'js/src/carousel.js')
| -rw-r--r-- | js/src/carousel.js | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/js/src/carousel.js b/js/src/carousel.js index 1aca817f1..7c2da45ad 100644 --- a/js/src/carousel.js +++ b/js/src/carousel.js @@ -120,10 +120,9 @@ const Carousel = (($) => { // public next() { - if (this._isSliding) { - throw new Error('Carousel is sliding') + if (!this._isSliding) { + this._slide(Direction.NEXT) } - this._slide(Direction.NEXT) } nextWhenVisible() { @@ -134,10 +133,9 @@ const Carousel = (($) => { } prev() { - if (this._isSliding) { - throw new Error('Carousel is sliding') + if (!this._isSliding) { + this._slide(Direction.PREV) } - this._slide(Direction.PREV) } pause(event) { |
