-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
honor wrap option in Carousel.getItemForDirection #15152
Conversation
var activeIndex = this.getItemIndex(active) | ||
var willWrap = (direction == 'prev' && activeIndex === 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for the strict comparison here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The JSCS check complains otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess because of false == 0
. Never mind then.
Otherwise LGTM. +:100: for the unit tests. |
@XhmikosR LGTY? |
Sorry, I missed the notification :/ Is the JSFiddle example right? I can't see next at all, only the previous link. |
Yeah, the example from the other issue that I based the demo on is a bit off. Here's one with fixed next/prev icons: http://jsfiddle.net/9qxsyf27/4/ |
That code is something I'm not very familiar with, but I think they look good, as far as I can tell. And unit tests are a huge plus. |
honor wrap option in Carousel.getItemForDirection [skip validator]
Fixes #15144. Demo: http://jsfiddle.net/9qxsyf27/1/
Also adds unit test for Carousel's
wrap
option to avoid such regressions in the future.CC: @KostyaTretyak @hnrch02 @XhmikosR @fat