Changeset - d426fe131196
[Not reviewed]
default
0 2 0
Thomas De Schampheleire - 6 years ago 2019-11-19 21:47:15
thomas.de_schampheleire@nokia.com
Grafted from: 640b01778731
js: replace jQuery's deprecated .size() with .length

The jQuery 3.0 upgrade guide states that the .size() function has been
removed, and is to be replaced with .length.

https://jquery.com/upgrade-guide/3.0/#breaking-change-deprecated-size-removed
2 files changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
kallithea/public/js/base.js
Show inline comments
 
@@ -694,13 +694,13 @@ function _comment_div_append_form($comme
 
                alert('Cannot delete pull request while making other changes');
 
                return false;
 
            }
 
            if (!confirm('Confirm to delete this pull request')) {
 
                return false;
 
            }
 
            var comments = $('.comment').size();
 
            var comments = $('.comment').length;
 
            if (comments > 0 &&
 
                !confirm('Confirm again to delete this pull request with {0} comments'.format(comments))) {
 
                return false;
 
            }
 
        }
 

	
kallithea/templates/changeset/changeset_file_comment.html
Show inline comments
 
@@ -195,13 +195,13 @@
 
<script>
 

	
 
$(document).ready(function () {
 

	
 
   $(window).on('beforeunload', function(){
 
      var $textareas = $('.comment-inline-form textarea[name=text]');
 
      if($textareas.size() > 1 ||
 
      if($textareas.length > 1 ||
 
         $textareas.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.';
 
      }
 
   });
0 comments (0 inline, 0 general)