changeset 7175:bedccdc47bd9

comments: don't leave stray "Add Another Comment" buttons after cancelling adding comments on a new line 2e72d2d16a0f introduced an invisible "submitting" div above comment forms. That div was included when counting the number of comments on a line, and it thus broke the logic for removing the last DOM elements after cancelling comments on a new line. To fix that, exclude the submitting div in the selector used for counting comments.
author Mads Kiilerich <mads@kiilerich.com>
date Wed, 21 Feb 2018 01:27:43 +0100
parents 65069004c2a2
children 17c999c48ab6
files kallithea/public/js/base.js
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/public/js/base.js	Fri Feb 16 02:13:28 2018 +0100
+++ b/kallithea/public/js/base.js	Wed Feb 21 01:27:43 2018 +0100
@@ -620,7 +620,7 @@
     var show_form = show_form_opt !== undefined ? show_form_opt : !f_path && !line_no;
     var $forms = $comment_div.children('.comment-inline-form');
     var $buttonrow = $comment_div.children('.add-button-row');
-    var $comments = $comment_div.children('.comment');
+    var $comments = $comment_div.children('.comment:not(.submitting)');
     $forms.remove();
     $buttonrow.remove();
     if (show_form) {