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

honor wrap option in Carousel.getItemForDirection #15152

Merged
merged 2 commits into from
Nov 17, 2014
Merged

honor wrap option in Carousel.getItemForDirection #15152

merged 2 commits into from
Nov 17, 2014

Conversation

cvrebert
Copy link
Collaborator

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

@cvrebert cvrebert added this to the v3.3.2 milestone Nov 16, 2014
@cvrebert cvrebert added the js label Nov 16, 2014
var activeIndex = this.getItemIndex(active)
var willWrap = (direction == 'prev' && activeIndex === 0)
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

Copy link
Collaborator

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.

@hnrch02
Copy link
Collaborator

hnrch02 commented Nov 16, 2014

Otherwise LGTM. +:100: for the unit tests.

@cvrebert
Copy link
Collaborator Author

@XhmikosR LGTY?

@XhmikosR
Copy link
Member

Sorry, I missed the notification :/

Is the JSFiddle example right? I can't see next at all, only the previous link.

@cvrebert
Copy link
Collaborator Author

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/
But more importantly, do the code changes look okay?

@XhmikosR
Copy link
Member

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.

cvrebert added a commit that referenced this pull request Nov 17, 2014
honor wrap option in Carousel.getItemForDirection
[skip validator]
@cvrebert cvrebert merged commit 8df9298 into master Nov 17, 2014
@cvrebert cvrebert deleted the fix-15144 branch November 17, 2014 09:43
@juthilo juthilo mentioned this pull request Nov 17, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Carousel still wraps even with wrap = false (on bootstrap 3.3.1)
3 participants