Skip to content

Commit

Permalink
Correct reference to Direction.PREV constant. (#21709)
Browse files Browse the repository at this point in the history
  • Loading branch information
pvdlg authored and bardiharborow committed Jan 15, 2017
1 parent c80e13a commit 8fbd4aa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions js/src/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const Carousel = (($) => {
if (this._isSliding) {
throw new Error('Carousel is sliding')
}
this._slide(Direction.PREVIOUS)
this._slide(Direction.PREV)
}

pause(event) {
Expand Down Expand Up @@ -195,7 +195,7 @@ const Carousel = (($) => {

const direction = index > activeIndex ?
Direction.NEXT :
Direction.PREVIOUS
Direction.PREV

this._slide(direction, this._items[index])
}
Expand Down Expand Up @@ -263,7 +263,7 @@ const Carousel = (($) => {

_getItemByDirection(direction, activeElement) {
const isNextDirection = direction === Direction.NEXT
const isPrevDirection = direction === Direction.PREVIOUS
const isPrevDirection = direction === Direction.PREV
const activeIndex = this._getItemIndex(activeElement)
const lastItemIndex = this._items.length - 1
const isGoingToWrap = isPrevDirection && activeIndex === 0 ||
Expand All @@ -273,7 +273,7 @@ const Carousel = (($) => {
return activeElement
}

const delta = direction === Direction.PREVIOUS ? -1 : 1
const delta = direction === Direction.PREV ? -1 : 1
const itemIndex = (activeIndex + delta) % this._items.length

return itemIndex === -1 ?
Expand Down

0 comments on commit 8fbd4aa

Please sign in to comment.