Changeset - bedccdc47bd9
[Not reviewed]
default
0 1 0
Mads Kiilerich - 8 years ago 2018-02-21 01:27:43
mads@kiilerich.com
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.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
kallithea/public/js/base.js
Show inline comments
 
@@ -620,7 +620,7 @@ function comment_div_state($comment_div,
 
    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) {
0 comments (0 inline, 0 general)