diff --git a/opentech/static_src/src/javascript/apply/edit-comment.js b/opentech/static_src/src/javascript/apply/edit-comment.js index 913745aa89b685a580f3bbcf8059ae1987647e1a..6ac52743250034713bda2568ebfbae672d3f02bf 100644 --- a/opentech/static_src/src/javascript/apply/edit-comment.js +++ b/opentech/static_src/src/javascript/apply/edit-comment.js @@ -16,6 +16,8 @@ $(editButton).click(function (e) { e.preventDefault(); + closeAllEditors(); + const editBlockWrapper = $(this).closest(feedContent).find(editBlock); const commentWrapper = $(this).closest(feedContent).find(comment); const commentContents = $(commentWrapper).data('comment'); @@ -105,4 +107,11 @@ const updateComment = (el, id, newComment) => { $(el).html(newComment).data('comment', newComment).data('id', id); }; + + const closeAllEditors = () => { + $(comment).show(); + $(pageDown).remove(); + $(editButton).show(); + }; + })(jQuery);