Added "seamless" page transition option#64
Open
jasonbnewell wants to merge 9 commits intoryrych:masterfrom
Open
Added "seamless" page transition option#64jasonbnewell wants to merge 9 commits intoryrych:masterfrom
jasonbnewell wants to merge 9 commits intoryrych:masterfrom
Conversation
…e first loop page: i.e. [FGABC])
…: BOOL and honestPageCount: BOOL. The Honest Page Count setting is disabled by default when seamless is enabled. This is to preserve familiar functionality in cases like the gotopage and lightbox examples. When honestPageCount is disabled, the USEFUL page count will be returned. The first set of pages before repeating elements is returned. This will cause some elements to be cut off in cases where visible % total elements != 0, but will allow consistent page transitions.
…html example page
…eration before elements repeat. This is a desirable option in cases where page selection controls are used instead of prev/next.
|
Thank you! |
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.
I hacked out a version of this a few months ago and just took the time to build it into your widget properly. This has been tested with all original examples (even ajax) as well as my own version of the examples with the option enabled ("continuous" folder - removed in one of the last commits - you can check them out if you just load up the one before that).
I've tried to keep the code/example style as close to the original as possible. I've also made extra effort to reuse as much of the existing code as I could as well (I went from adding about 100 lines of code to simplifying the original enough that this new version is actually slightly shorter). The paginate function could probably be merged a bit more, but it's pretty close.
I built this feature into the existing code as deep as possible, and was able to avoid a major overhaul. This option works by looping over the elements and generating pages until a page that contains the last STEP elements is created (filled out with the beginning elements). I've added examples in the comments.
I've added an option that will stop page generation before elements begin repeating, along with an example. This is desirable in cases (especially if auto is enabled) where page selection controls are shown to the user instead of prev/next control.
I hope you have the time to review this and add it to this codebase. I've seen that this is a pretty commonly requested feature and I've spent some time ensuring that this addition doesn't break anything.
Thanks.