Fix #4840: Forum post interface is not updated correctly after deletion.
Re-render and replace the whole forum post with AJAX when a forum post is deleted or undeleted. This is easier now that forum posts are componentized.
This commit is contained in:
@@ -1 +1 @@
|
||||
$("article[data-forum-post-id=<%= @forum_post.id %>] div.author div.author-name").append(" (deleted)");
|
||||
$("#forum_post_<%= @forum_post.id %>").replaceWith("<%= j render(ForumPostComponent.new(forum_post: @forum_post, current_user: CurrentUser.user)) %>");
|
||||
|
||||
@@ -1 +1 @@
|
||||
location.reload();
|
||||
$("#forum_post_<%= @forum_post.id %>").replaceWith("<%= j render(ForumPostComponent.new(forum_post: @forum_post, current_user: CurrentUser.user)) %>");
|
||||
|
||||
Reference in New Issue
Block a user