# HG changeset patch # User Thomas De Schampheleire # Date 2019-11-19 21:47:15 # Node ID d426fe1311967fdd7aa1917e8e14aa2df73ef727 # Parent 34c8cb3198d8bd15204c827399acbac63b0917d8 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 diff --git a/kallithea/public/js/base.js b/kallithea/public/js/base.js --- a/kallithea/public/js/base.js +++ b/kallithea/public/js/base.js @@ -697,7 +697,7 @@ function _comment_div_append_form($comme 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; diff --git a/kallithea/templates/changeset/changeset_file_comment.html b/kallithea/templates/changeset/changeset_file_comment.html --- a/kallithea/templates/changeset/changeset_file_comment.html +++ b/kallithea/templates/changeset/changeset_file_comment.html @@ -198,7 +198,7 @@ $(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