Fix javascript errors when changing diff revisions too fast.

Review Request #6280 — Created Aug. 27, 2014 and submitted

Information

Review Board
release-2.0.x
a219b9e...

Reviewers

When the diff revision sliders are moved before all the files on a page finish
loading, it can cause a javascript error. The cause here is that the
DiffReviewable has an outstanding fetch, which attempts to render the file once
it finishes. If the element disappears, we try to dereference things which are
now undefined. I've made it test to see whether the target element is present
before creating the DiffReviewableView, which avoids all of the problems.

Flipped around to a bunch of different diff revisions, changing things before
all files loaded. After this change, everything works swimmingly.

Description From Last Updated

Indentation is off. Should be unindented one level.

chipx86chipx86
reviewbot
  1. Tool: PEP8 Style Checker
    Ignored Files:
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
    
    Tool: Pyflakes
    Ignored Files:
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
  2. 
      
chipx86
  1. 
      
  2. Show all issues

    Indentation is off. Should be unindented one level.

  3. 
      
david
reviewbot
  1. Tool: PEP8 Style Checker
    Ignored Files:
        reviewboard/static/rb/js/pages/views/diffViewerPageView.js
    
    
    
    Tool: Pyflakes
    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 (22f9823).
Loading...