Add infinite scrolling to the diff viewer
Review Request #7047 — Created March 12, 2015 and discarded — Latest diff uploaded
Add infinite scrolling to the diff viewer.
When working with long diffs, it's common for the diffs to be split up across
several pages. This can end up being a pain to review, as it means having to
deal with manual pagination.This change replaces the pagination to scroll loading. When user scroll to the
bottom of the page, diffs will be loaded automatically without having to click
anything.First bind a listening function to the window to check the position. And when
it detect scroll bar touch the bottom, it will active the loading function to
load next diffs. The loading function use ajax to load pagination's diffs, and
append to the current pagination. Similar to the set, when update the diffs,
properties should update one by one.Remove the pagination and page selection, and modify the description of 'paginate
by' and 'paginate orphans'.
Passed all js-tests.
Manual tests with a 25 diff files review request.
Paginate by 2, and paginate orphans is 10.When first load the pages, the page loads 2 diffs, and scroll to the bottom, it
loads 2 another difss. At last, the page loads 10 diffs.
Diff Revision 4
This is not the most recent revision of the diff. The latest diff is revision 17. See what's changed.
reviewboard/static/rb/js/diffviewer/views/diffFileIndexView.js |
---|
reviewboard/static/rb/js/pages/models/diffViewerPageModel.js |
---|
reviewboard/static/rb/js/pages/views/diffViewerPageView.js |
---|