Split per-fragment handling out of DiffFragmentQueueView.
Review Request #9117 — Created Aug. 3, 2017 and submitted
Originally,
DiffFragmentQueueView
's sole responsibility was to handle
the queueing and loading of fragments from the server and to inject
those fragments into the DOM. Over time, it's been expanded to handle
interaction on each fragment. This added to the complexity a bit,
requiring additional bookkeeping and expensive selectors that worked
across the whole page.This change splits the per-fragment handling out of
DiffFragmentQueueView
and into its ownDiffFragmentView
class. This
handles the hover controls and expansion/collapsing logic. The
mouse/click events and centered collapse button tracking are all handled
per-view now, allowing the event selectors and button bookkeeping to be
more efficient. The view now only keeps theCenteredElementManager
around when needed, and doesn't require a page-wide selector every time
there's an expansion/collapse.Unit tests have been updated for
DiffFragmentQueueView
for some of the
new tracking, and new tests were added forDiffFragmentView
.
Unit tests pass.
Manually tested that all hover, expansion, and collapsing logic all
worked correctly.
- Change Summary:
-
Fleshed out docs.
- Commit:
-
edb82660e21a682de9e221048dcfa16a5499f0d0d6514035abc6561242235f13bad72c603e091087
- Diff:
-
Revision 2 (+535 -246)