Introduce PageManager for dealing with the page state.

Review Request #4383 — Created Aug. 3, 2013 and submitted

Information

Review Board
master

Reviewers

Introduce PageManager for dealing with the page state.

PageManager replaces manual access of RB.currentPage. It allows setting
and getting the current page, and hooking up callbacks for when the page
is set and when it's fully ready (set + DOM rendered).

There's ever really one PageManager that code will interact with. As a
convenience, PageManager has a few forwarding functions that operate on
the instance. They're mostly pass-through, with some convenience around
attributes.

The templates have been updated to use the new functions. In some cases,
we still enclose the call to PageManager.ready() inside a
document.ready(), just because "RB" doesn't exist yet.
Tested each type of page.

All unit tests pass.

JSHint was happy.
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        reviewboard/settings.py
      Ignored Files:
        reviewboard/templates/reviews/review_detail.html
        reviewboard/static/rb/js/pages/models/tests/pageManagerModelTests.js
        reviewboard/templates/reviews/ui/base.html
        reviewboard/static/rb/js/pages/models/pageManagerModel.js
        reviewboard/static/rb/js/views/commentIssueBarView.js
        reviewboard/templates/diffviewer/view_diff.html
        reviewboard/templates/reviews/ui/default.html
        reviewboard/templates/reviews/reviewable_base.html
        reviewboard/static/rb/js/views/commentDialogView.js
    
    
  2. 
      
reviewbot
  1. This is a review from Review Bot.
      Tool: Pyflakes
      Processed Files:
        reviewboard/settings.py
      Ignored Files:
        reviewboard/templates/reviews/review_detail.html
        reviewboard/static/rb/js/pages/models/tests/pageManagerModelTests.js
        reviewboard/templates/reviews/ui/base.html
        reviewboard/static/rb/js/pages/models/pageManagerModel.js
        reviewboard/static/rb/js/views/commentIssueBarView.js
        reviewboard/templates/diffviewer/view_diff.html
        reviewboard/templates/reviews/ui/default.html
        reviewboard/templates/reviews/reviewable_base.html
        reviewboard/static/rb/js/views/commentDialogView.js
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Loading...