Changeset - 749b5e8cead3
[Not reviewed]
default
0 1 0
Jan Heylen - 11 years ago 2015-01-30 20:57:02
heyleke@gmail.com
comment: warn before leaving page with open comments
1 file changed with 8 insertions and 0 deletions:
0 comments (0 inline, 0 general)
kallithea/templates/changeset/changeset_file_comment.html
Show inline comments
 
@@ -198,12 +198,20 @@
 

	
 
<script>
 

	
 
$(document).ready(function () {
 
   MentionsAutoComplete('text', 'mentions_container', _USERS_AC_DATA, _GROUPS_AC_DATA);
 

	
 
   $(window).on('beforeunload', function(){
 
      if($('.form-open').size() || $('textarea#text').val()){
 
         // this message will not be displayed on all browsers
 
         // (e.g. some versions of Firefox), but the user will still be warned
 
         return 'There are uncommitted comments.';
 
      }
 
   });
 

	
 
   $('#preview-btn').click(function(){
 
       var _text = $('#text').val();
 
       if(!_text){
 
           return;
 
       }
 
       var post_data = {'text': _text};
0 comments (0 inline, 0 general)