-
Notifications
You must be signed in to change notification settings - Fork 75
Issue #20: mirrored items visible #21
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
base: master
Are you sure you want to change the base?
Issue #20: mirrored items visible #21
Conversation
This fixes an issue where mirrored items would be visible in the carousel when all of the items could fit into the visible space of the carousel. The behavior has been changed as follows: * When the update() method is invoked, the mirrored items will only be appended if there are slides that will not fit into the visible area of the carousel. * If infinite scrolling and buttons are enabled, the buttons will be toggled with the "disable" class based on if there are items that do not fit into the visible area of the carousel. * If the "disable" class is applied to the buttons, it will not advance the slides. * If you resize the window, the slide you are currently on will be "moved to".
| if(self.options.buttons) { | ||
| $prev.click(function() { | ||
| self.move(--slideIndex); | ||
| if(!$(this).hasClass("disable")) { |
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'm not sure if the original intention was to have the person implementing the class to handle the disable CSS class on their own. e.g., Check for disable and remove events if desired. It felt "right" to me to just do this in the plugin.
| } | ||
| }); | ||
|
|
||
| _setButtons(); |
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.
This is the one change I'm not 100% sure won't have side effects. When the plugin first loads, _intialize() calls update() which in turn calls _setButtons(). _initialize() then calls move() which had the _setButtons() call above. This was causing the disable class to get set appropriately on the first call and then turned off on this second call.
* Updating behavior of "selected slide" to move to the first slide in the list if all the slides fit the visible area of the carousel.
This fixes an issue where mirrored items would be visible in the carousel when all of the items could fit into the visible space of the carousel. The behavior has been changed as follows: