Fix centering the collapse button in diff fragments.

Review Request #9136 — Created Aug. 14, 2017 and submitted

Information

Review Board
release-3.0.x
058c52f...

Reviewers

When the code for handling the vertical centering of the collapse button
for diff fragments was moved into RB.CenteredElementManager, the
centering logic regressed. The new logic expected that the element would
center relative to a single container, but the old logic carefully
calculated a top and bottom container for the centering, allowing the
collapse button to appear correctly centered across several diff chunks.

RB.CenteredElementManager now allows for a top and bottom container to
be specified, and will use both of those for the centering logic. If
only a top container is specified, it will be used for both.

This fixes the display of the collapse button when expanding diffs.

Expanded several diff fragments in both directions, repeatedly, and
saw that the collapse button was always properly vertically centered in
relation to the entire visible diff area, and to the screen.

david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-3.0.x (840cb4a)