From 03f4c23024524eb5b27ac24fe29c21dce02bb405 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 9 Aug 2018 21:54:12 -0600 Subject: [PATCH] Update commentform component --- resources/assets/js/components/commentform.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/resources/assets/js/components/commentform.js b/resources/assets/js/components/commentform.js index a2aa50394..c9d4f9477 100644 --- a/resources/assets/js/components/commentform.js +++ b/resources/assets/js/components/commentform.js @@ -1,6 +1,12 @@ $(document).ready(function() { - $('.status-comment-focus').on('click', function(el) { + $('.status-card > .card-footer').each(function() { + $(this).addClass('d-none'); + }); + + $(document).on('click', '.status-comment-focus', function(el) { + var form = $(this).parents().eq(2).find('.card-footer'); + form.removeClass('d-none'); var el = $(this).parents().eq(2).find('input[name="comment"]'); el.focus(); }); @@ -31,7 +37,7 @@ $(document).ready(function() { var comment = '

' + username + ''+ reply + '1s

'; - comments.prepend(comment); + comments.append(comment); commentform.val(''); commentform.blur(); @@ -41,7 +47,5 @@ $(document).ready(function() { .catch(function (res) { }); - }); - }); \ No newline at end of file