Sha256: 47504fe1f7a43927b9197fb4e5ca8834e223be7617df6074b9f48a700b548ae1
Contents?: true
Size: 1.07 KB
Versions: 10
Compression:
Stored size: 1.07 KB
Contents
$(() => { const deleteDataHtml = '<%== j(render partial: "delete", locals: { comment: @comment }).strip %>'; const rootCommentableId = <%== "comments-for-#{@comment.root_commentable.commentable_type.demodulize}-#{@comment.root_commentable.id}".to_json %>; const commentId = <%= @comment.id.to_json %>; const $comment = $(`#comment_${commentId}`); const $commentReply = $(`#comment${commentId}-reply`); const $content = $("> .comment__content", $comment); const sectionsToDelete = ["footer-grid", "reply"]; sectionsToDelete.forEach((section) => { $(`#comment_${commentId} > [data-comment-footer] > .comment__${section}`).remove(); }); $(`#comment_${commentId} > .comment__header`).remove(); $(`#comment_${commentId} > [data-additional-reply]`).remove(); $commentReply.remove(); $content.replaceWith(deleteDataHtml); Rails.fire(document, "comments:loaded", { commentsIds: [commentId] }); $(".comments-count", $(`#${rootCommentableId}`)).text(<%== t("decidim.components.comments.title", count: @comment.root_commentable.comments_count).to_json %>); });
Version data entries
10 entries across 10 versions & 1 rubygems