Fix JS errors when closing the "Add File" dialog.

Review Request #2039 — Created Nov. 15, 2020 and updated

guest9543
Review Board
demo
DialogView subclasses (such as "Add File") could sometimes cause JS
errors when they were closing. The issue here was a race between
multiple event handlers. Inside the `modalBox` implementation (which is
all our own jQuery-UI based code), a generic handler for clicks in the
button area would cause the modal box to self-destruct. This could then
conflict with the higher-level DialogView code which would additionally
try to call destroy. In previous versions of jQuery-UI this didn't
matter, but the version we're using now will error out when calling
methods on elements which are not widgets.

This change adds a check to make sure we don't try to destroy the
modalBox widget after it's already self-destructed.

Testing Done:
- Manually tested the "Add File" dialog.
- Ran js-tests without any modalBox-related errors.

Reviewed at https://reviews.reviewboard.org/r/11254/

Done

Description From Last Updated

Hi

guest9543guest9543

Comment

guest690guest690

test

guest5148guest5148

ciao

guest5148guest5148

Single line comment

guest5300guest5300

Multi line comment

guest5300guest5300

Great!?

guest690guest690

new line

guest1630guest1630
guest9543
guest9543
  1. Ship It!

  2. 
      
guest9543
guest9543
  1. Done

  2. 
      
guest9543
guest9543
  1. Ship It!
  2. 
      
guest9543
Review request changed

Status: Re-opened

guest5148
guest5148
guest5122
  1. ???????

  2. 
      
guest690
guest690
  1. test header

  2. 
      
guest5300
  1. 
      
  2. Single line comment

  3. Multi line comment

  4. 
      
guest5300
  1. 
      
  2. reviewboard/static/rb/js/ui/views/dialogView.es6.js (Diff revision 1)
     
     
     
     
     

    Comment without issue

  3. 
      
guest1630
guest5991
  1. Ship It!
  2. 
      
Loading...