• 
      

    Fix updating the diff index when switching diff pages from the bottom.

    Review Request #13314 — Created Oct. 6, 2023 and submitted — Latest diff uploaded

    Information

    Review Board
    release-6.x

    Reviewers

    When the diff file index is in docked mode, and the user switches which
    page was visible, we would hit an error and the file index would fail to
    update as the diff was loading, leaving every file showing a spinner.

    The problem is that when the page is scrolled, we redock the items table
    elsewhere onto the page. Inside the #update() method we would load all
    the new items, but then reset the #$items variable to be tr
    (grand)children of the view's element, which was empty because the table
    was a child of the banner instead.

    I've updated it to explicitly set #$items to be tr children of the
    items table. While in here, I realized that the way we're assembling the
    items table is quite inefficient, so I fixed this up to assemble all the
    child nodes first and then add them all to the DOM at the same time.

    • Ran js-tests.
    • Switched around between pages of a very large diff. Made sure that
      the paginators at both the top and bottom of the page worked
      correctly.

    Commits

    Files