Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Carousel: fix reference to non-existing constant #21709

Merged
merged 1 commit into from
Jan 15, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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