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.
Additionally fix display issue for infinite scroll 'blank block' #2535
Code changes enable infinite scroll up. Changes are as follows:
File: misc/tutorial/212_infinite_scroll.ngdoc
Update documentation to load the data for up and adjust the load data
for down to append to exiting data, not overwrite the hashKeys
src/features/infinite-scroll/js/infinite-scroll.js
Updated file to add new needLoadMoreDataTop method and supporting code
to call method.
src/features/infinite-scroll/test/infiniteScroll.spec.js
Updated unit test to test for needMoreLoadDataTop
src/js/core/constants.js
Added new constant for scroll direction
src/js/core/directives/ui-grid-viewport.js
Added supporting logic to set scroll direction properly
src/js/core/directives/ui-grid.js
Added new function to adjust scroll position after an infinite scroll
data load up or down.
src/js/core/factories/Grid.js
Added logic to reset scroll direction to none after a debounce as well
as increased debounce to 1000 to allow for timeout added to reset scroll
position to execute
src/js/core/factories/GridRenderContainer.js
Added logic too datawatch function to calculate the row to scroll to
after a data load. The up scroll is tricky because you ahve to find the
row you were on in the new data array. This was done by searching for
the hashKey of the row we were on. Supporting code was also added. The
"blank block" issue was fixed here by allowing the logic to execute if
infinite scroll is enabled.