Sha256: 5fb793510092282efccadf4944e7ad9e2f1de404e40ff10526b471608613e9c2
Contents?: true
Size: 836 Bytes
Versions: 13
Compression:
Stored size: 836 Bytes
Contents
$(() => { var rootCommentableId = <%== "comments-for-#{@commentable.class.name.demodulize}-#{@commentable.id}".to_json %>; var $comments = $("#" + rootCommentableId); var config = $comments.data("decidim-comments"); component = new Decidim.CommentsComponent($comments, config); component.unmountComponent(); var commentHtml = '<%== j(render partial: "edited_comment", locals: { comment: @comment }).strip %>'; var commentId = <%= @comment.id.to_json %>; var $comment = $("#comment_<%= @comment.id %>"); $comment.replaceWith(commentHtml); // Re-create the component component = new Decidim.CommentsComponent($comments, $comments.data("decidim-comments")); component.mountComponent(); $comments.data("comments", component); Rails.fire(document, "comments:loaded", { commentsIds: [commentId] }); });
Version data entries
13 entries across 13 versions & 1 rubygems