diff options
| author | Mark Otto <[email protected]> | 2016-12-02 10:13:36 -0800 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2016-12-02 10:13:36 -0800 |
| commit | 3ec37d4a4d043ded903c807818e7894de084409f (patch) | |
| tree | aaf483f062a7f721093632df5d0d198e9830dacc /js/dist/carousel.js | |
| parent | e3a569f4f6ab326d78300c6a8ab3e3766075cfd0 (diff) | |
| download | bootstrap-3ec37d4a4d043ded903c807818e7894de084409f.tar.xz bootstrap-3ec37d4a4d043ded903c807818e7894de084409f.zip | |
grunt
Diffstat (limited to 'js/dist/carousel.js')
| -rw-r--r-- | js/dist/carousel.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/js/dist/carousel.js b/js/dist/carousel.js index 8b6119a07..60803b9fc 100644 --- a/js/dist/carousel.js +++ b/js/dist/carousel.js @@ -108,9 +108,10 @@ var Carousel = function ($) { // public Carousel.prototype.next = function next() { - if (!this._isSliding) { - this._slide(Direction.NEXT); + if (this._isSliding) { + throw new Error('Carousel is sliding'); } + this._slide(Direction.NEXT); }; Carousel.prototype.nextWhenVisible = function nextWhenVisible() { @@ -121,9 +122,10 @@ var Carousel = function ($) { }; Carousel.prototype.prev = function prev() { - if (!this._isSliding) { - this._slide(Direction.PREVIOUS); + if (this._isSliding) { + throw new Error('Carousel is sliding'); } + this._slide(Direction.PREVIOUS); }; Carousel.prototype.pause = function pause(event) { |
