Skip to content
This repository has been archived by the owner on Feb 24, 2023. It is now read-only.

Commit

Permalink
Fixed bug when adding agile__slide--current class to slides when infi…
Browse files Browse the repository at this point in the history
…nite == true and centerMode == false.
  • Loading branch information
Adam Britto authored and Adam Britto committed May 2, 2019
1 parent 3039aca commit 22beb23
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Agile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,8 @@
start -= (Math.floor(this.settings.slidesToShow / 2) - +(this.settings.slidesToShow % 2 === 0))
}
for (let i = start; i < start + this.settings.slidesToShow; i++) {
// To account for the combination of infinite = false and centerMode = true, ensure we don't overrun the bounds of the slide count.
for (let i = Math.max(start, 0); i < Math.min(start + this.settings.slidesToShow, this.slidesCount) ; i++) {
this.allSlides[i].classList.add('agile__slide--current')
}
},
Expand Down

0 comments on commit 22beb23

Please sign in to comment.