Fix warning for unsaved work on beforeUnload

Review Request #485 — Created March 17, 2017 and updated

guest822
Review Board
176916d...
demo
Previously, when editing a review or comments as a user without edit rights,
warning users about losing unsaved work did not get displayed.

Now the ReviewRequestEditorView's beforeUnload event handler does not check a
user's edit rights and only checks to see if any fields are being edited at the
moment.

New unit tests testing the onBeforeUnload event handler has been added.

Testing Done:
- Ran JS unit tests.
- Check that ReviewDialogView for both edit and non-edit privileged users are
  warned before unloading.

Bugs closed: 4084

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


Description From Last Updated

444

guest7326guest7326

add general comment

guest3266guest3266

Where is this?

guest7211guest7211

ERROR################

guest7055guest7055

ffffff

guest7055guest7055

ijnjnj

guest7780guest7780

asdasd asdasdkjkn

guest4466guest4466

asdf

guest7622guest7622

expand

guest2546guest2546

123

guest1533guest1533

// is code rendered? if ((this.model.get('editable)) { return msg; } header

guest7668guest7668

how about message

guest2546guest2546

Test1

guest7324guest7324

keep die return statement

guest3872guest3872

This is not this

guest3703guest3703

comment AAA BBB CCC

guest117guest117

Test2

guest7324guest7324

This sounds strange....

guest7324guest7324

Test3

guest7324guest7324

Test4

guest7324guest7324
guest3123
  1. Ship It!
  2. 
      
guest3627
  1. test

  2. 
      
guest3627
  1. 
      
  2. 
      
guest1059
  1. Ship It!
  2. 
      
guest7668
  1. 
      
  2. // is code rendered?
    if ((this.model.get('editable)) {
    return msg;
    }

    header

  3. 
      
guest7326
guest7326
  1. 
      
  2. 4449

  3. 
      
guest7326
  1. Ship It!
  2. 
      
guest7211
  1. 
      
  2. reviewboard/static/rb/js/views/reviewRequestEditorView.js (Diff revision 1)
     
     
     
     
     
     

    Where is this?

  3. 
      
guest117
guest7622
guest1533
guest2546
guest7324
guest7324
guest7780
guest3266
  1. 
      
  2. add general comment

  3. 
      
guest3703
guest7055
  1. 
      
  2. reviewboard/static/rb/js/views/reviewRequestEditorView.js (Diff revision 1)
     
     
     
     
     
     
     
     
     
     
     
     

    ERROR################

  3. reviewboard/static/rb/js/views/reviewRequestEditorView.js (Diff revision 1)
     
     
     
     
     
     
     
     
  4. ffaaa

guest6813
  1. 
      
  2. second comment on same line

  3. 
      
guest4466
guest3872
  1. 
      
  2. reviewed. ok
  3. 
      
guest3872
  1. Here my 2€

  2. keep die return statement
  3. i don't like this comment
  4. Ende

guest3872
  1. Ship It!

  2. 
      
Loading...