Infinite Scroll: in auto scroll mode or on page load, don't run if there are no entries to load.#3553
Merged
gravityrail merged 2 commits intomasterfrom Jul 24, 2016
Merged
Conversation
a574b5a to
ff6c86c
Compare
ff6c86c to
fc61443
Compare
Member
|
Looks like this one is in need of a rebase. |
fc61443 to
61fb075
Compare
Contributor
Author
|
Rebased. |
It's not necessary to check for responses of empty type the next time, since we disabled scroller by then.
…l at least once. The ::is_last_batch method was rewritten to more reliable reflect if it's the last batch. There were cases where it failed, for example: when there were 15 posts and IS displayed 3 posts per page, the last ::is_last_batch compared 3 posts returned from db > 3 posts per page, which was false, and so IS thought there were most posts to fetch. It ran one more time but returned nothing, which is a confusing UX. This commit also addresses an issue of a missing dependency: when there were 3 posts and IS displayed 3 posts per page, it didn't enqueued the assets in ::action_template_redirect but the theme compatibility still required it. They are now registered regardless of whether they're enqueued or not, which solves the dependency issue.
Contributor
|
Nice! |
Contributor
|
Merged to 4.2 |
gravityrail
added a commit
that referenced
this pull request
Jul 24, 2016
…batch Infinite Scroll: in auto scroll mode or on page load, don't run if there are no entries to load.
This was referenced Oct 5, 2016
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.
Closes #3549.
Improvements to scroll behavior for better UX.
Changes proposed in this Pull Request:
For this, the
::is_last_batchmethod was rewritten to more reliably reflect if it's the last batch. There were cases where it failed, for example: when there were 15 posts and IS displayed 3 posts per page, the last::is_last_batchcompared3 (posts returned from db) > 3 (posts per page), which was false, that is, not the last batch, so IS thought there were most posts to fetch. It ran one more time returning nothing, which is a confusing UX.::action_template_redirectbut the theme compatibility still required them. They are now registered separately from their enqueuing, which solves the dependency issue.