Skip to content

Commit d3b0b6d

Browse files
authored
Fixed bug: Addressed issues with reply and edit comment features in the comment section. (#1680)
1 parent 0195edb commit d3b0b6d

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

website/static/js/issue.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,13 @@ $(function () {
8181

8282
$('body').on('click', '.edit_comment', function (e) {
8383
e.preventDefault();
84-
comment_id = $(this).attr('name');
8584
old_message = $(this).parent().next().next().text();
86-
$(this).parent().next().show();
87-
$(this).parent().next().find('textarea').val(old_message);
85+
comment_id = $(this).attr('name');
8886
$(this).hide();
87+
$(this).next('.edit_comment').hide();
8988
$(this).next('.del_comment').hide();
90-
$(this).parent().next().next().hide();
89+
$(this).parent().next().find('textarea').val(old_message);
90+
$(this).parent().parent().next().show();
9191
});
9292

9393
$(document).on('click', '.edit_form button[type="submit"]', function (e) {
@@ -113,10 +113,7 @@ $(function () {
113113
$('body').on('click', '.reply_comment', function (e) {
114114
e.preventDefault();
115115
comment_id = $(this).attr('name');
116-
$(this).hide();
117-
$(this).next('.edit_comment').hide();
118-
$(this).next().next('.del_comment').hide();
119-
$(this).parent().parent().next().show();
116+
$(this).parent().parent().parent().next().toggle();
120117
});
121118

122119
$(document).on('click', '.reply_form button[type="submit"]', function (e) {

0 commit comments

Comments
 (0)