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/


  • 15
  • 0
  • 4
  • 0
  • 19
Description From Last Updated
444 guest7326 guest7326
add general comment guest3266 guest3266
ERROR################ guest7055 guest7055
ffffff guest7055 guest7055
ijnjnj guest7780 guest7780
asdasd asdasdkjkn guest4466 guest4466
asdf guest7622 guest7622
expand guest2546 guest2546
// is code rendered? if ((this.model.get('editable)) { return msg; } header guest7668 guest7668
how about message guest2546 guest2546
Test1 guest7324 guest7324
This is not this guest3703 guest3703
Test2 guest7324 guest7324
Test3 guest7324 guest7324
Test4 guest7324 guest7324
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
Loading...