changeset 7962:d426fe131196

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
author Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
date Tue, 19 Nov 2019 21:47:15 +0100
parents 34c8cb3198d8
children 46681ae86693
files kallithea/public/js/base.js kallithea/templates/changeset/changeset_file_comment.html
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/public/js/base.js	Wed Nov 20 15:12:23 2019 +0100
+++ b/kallithea/public/js/base.js	Tue Nov 19 21:47:15 2019 +0100
@@ -697,7 +697,7 @@
             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;
--- a/kallithea/templates/changeset/changeset_file_comment.html	Wed Nov 20 15:12:23 2019 +0100
+++ b/kallithea/templates/changeset/changeset_file_comment.html	Tue Nov 19 21:47:15 2019 +0100
@@ -198,7 +198,7 @@
 
    $(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