Change how some child objects are stored on RB.DiffViewerPage.
Review Request #9163 - Created Aug. 31, 2017 and submitted
RB.DiffViewerPagemodel had a few helper child objects that were
responsible for different aspects of the page. These were stored as
attributes, in order to allow usage of
parse()to feed in data. That
required also modifying
set()to be able to update the existing
instances based on the attributes of newly-constructed ones from
parse(), and made working with the objects a bit awkward.
This change switches these objects to being constructed when creating
an instance of the model, and then filling the objects in
Model.initialize()to do this,
since the former will run before
us to create those objects. This is recommended in the Backbone
documentation for this use case.
Unit tests pass.
Tested loading diffs, switching revisions (single revisions and
interdiff ranges), and switching pages.