aboutsummaryrefslogtreecommitdiff
path: root/js/src/carousel.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/carousel.js')
-rw-r--r--js/src/carousel.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/js/src/carousel.js b/js/src/carousel.js
index e56d4f0f2..7fda8f615 100644
--- a/js/src/carousel.js
+++ b/js/src/carousel.js
@@ -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) {