Open
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")) { |
Author
There was a problem hiding this comment.
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(); |
Author
There was a problem hiding this comment.
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: