Skip to content
Snippets Groups Projects
Commit d131f9ef authored by Chris Lawton's avatar Chris Lawton
Browse files

only allow one editor to be open ay any given time

parent 738eb5e2
No related branches found
No related tags found
No related merge requests found
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
$(editButton).click(function (e) { $(editButton).click(function (e) {
e.preventDefault(); e.preventDefault();
closeAllEditors();
const editBlockWrapper = $(this).closest(feedContent).find(editBlock); const editBlockWrapper = $(this).closest(feedContent).find(editBlock);
const commentWrapper = $(this).closest(feedContent).find(comment); const commentWrapper = $(this).closest(feedContent).find(comment);
const commentContents = $(commentWrapper).data('comment'); const commentContents = $(commentWrapper).data('comment');
...@@ -105,4 +107,11 @@ ...@@ -105,4 +107,11 @@
const updateComment = (el, id, newComment) => { const updateComment = (el, id, newComment) => {
$(el).html(newComment).data('comment', newComment).data('id', id); $(el).html(newComment).data('comment', newComment).data('id', id);
}; };
const closeAllEditors = () => {
$(comment).show();
$(pageDown).remove();
$(editButton).show();
};
})(jQuery); })(jQuery);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment