From 3ec37d4a4d043ded903c807818e7894de084409f Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Fri, 2 Dec 2016 10:13:36 -0800 Subject: grunt --- js/dist/carousel.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'js/dist/carousel.js') 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) { -- cgit v1.2.3