From d3b0b6d401ceed12a07e2acb3949860356c807b3 Mon Sep 17 00:00:00 2001 From: Abhinav Kumar <96587705+kr-2003@users.noreply.github.com> Date: Mon, 22 Jan 2024 09:23:43 +0530 Subject: [PATCH] Fixed bug: Addressed issues with reply and edit comment features in the comment section. (#1680) --- website/static/js/issue.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/website/static/js/issue.js b/website/static/js/issue.js index ae174685e..a20d6b6af 100644 --- a/website/static/js/issue.js +++ b/website/static/js/issue.js @@ -81,13 +81,13 @@ $(function () { $('body').on('click', '.edit_comment', function (e) { e.preventDefault(); - comment_id = $(this).attr('name'); old_message = $(this).parent().next().next().text(); - $(this).parent().next().show(); - $(this).parent().next().find('textarea').val(old_message); + comment_id = $(this).attr('name'); $(this).hide(); + $(this).next('.edit_comment').hide(); $(this).next('.del_comment').hide(); - $(this).parent().next().next().hide(); + $(this).parent().next().find('textarea').val(old_message); + $(this).parent().parent().next().show(); }); $(document).on('click', '.edit_form button[type="submit"]', function (e) { @@ -113,10 +113,7 @@ $(function () { $('body').on('click', '.reply_comment', function (e) { e.preventDefault(); comment_id = $(this).attr('name'); - $(this).hide(); - $(this).next('.edit_comment').hide(); - $(this).next().next('.del_comment').hide(); - $(this).parent().parent().next().show(); + $(this).parent().parent().parent().next().toggle(); }); $(document).on('click', '.reply_form button[type="submit"]', function (e) {