Fix file links in multi-page diff views.

Review Request #7096 — Created March 20, 2015 and submitted

Information

Review Board
release-2.0.x
e77198e...

Reviewers

When using the file links in diffs that had multiple pages, the scroll position
would jump to the file, but then the diff viewer would immediately reload on
page 1. The issue here is that we were setting location.hash in order to update
the displayed URL to include the page number, and the backbone router was
interpreting that as an indication that it should reroute.

I've changed it to use router.navigate() with trigger: false. This updates
the displayed hash without actually triggering any routing.

Created a giant multi-page diff and loaded page 2. Clicked on a filename in the
file list. Saw that it jumped to the file and updated the displayed URL
correctly, and did not navigate back to page 1.

reviewbot
  1. Tool: Pyflakes
    Ignored Files:
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
    
    Tool: PEP8 Style Checker
    Ignored Files:
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
  2. 
      
chipx86
  1. Ship It!
  2. 
      
david
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-2.0.x (937e172)
Loading...