Sha256: 61b05e864062ac2a2b2291f69c5ffd16e5d6a1dcbe11267caeca7aec54992b02

Contents?: true

Size: 865 Bytes

Versions: 12

Compression:

Stored size: 865 Bytes

Contents

(function() {
  var rootCommentableId = <%== "comments-for-#{commentable.commentable_type.demodulize}-#{commentable.id}".to_json %>;

  var $comments = $("#" + rootCommentableId);
  var component = $comments.data("comments");

  $(".loading-comments").addClass("hide");
<% @comments.each do |comment| %>
  var commentId = <%= comment.id.to_json %>;
  var commentHtml = '<%== j(render comment).strip %>';
  var inReplyTo = <%== (reply?(comment) ? comment.commentable.id : nil).to_json %>;

  var $comment = $("#comment_" + commentId);
  if (1 > $comment.length) {
    if (inReplyTo) {
      component.addReply(inReplyTo, commentHtml);
    } else {
      component.addThread(commentHtml);
    }
  }
<% end %>

  // Update the comments count
  $(".comments-count", $comments).text(<%== t("decidim.components.comments.title", count: @comments_count).to_json %>);
}());

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
decidim-comments-0.27.9 app/views/decidim/comments/comments/index.js.erb
decidim-comments-0.27.8 app/views/decidim/comments/comments/index.js.erb
decidim-comments-0.27.7 app/views/decidim/comments/comments/index.js.erb
decidim-comments-0.27.6 app/views/decidim/comments/comments/index.js.erb
decidim-comments-0.27.5 app/views/decidim/comments/comments/index.js.erb
decidim-comments-0.27.4 app/views/decidim/comments/comments/index.js.erb
decidim-comments-0.27.3 app/views/decidim/comments/comments/index.js.erb
decidim-comments-0.27.2 app/views/decidim/comments/comments/index.js.erb
decidim-comments-0.27.1 app/views/decidim/comments/comments/index.js.erb
decidim-comments-0.27.0 app/views/decidim/comments/comments/index.js.erb
decidim-comments-0.27.0.rc2 app/views/decidim/comments/comments/index.js.erb
decidim-comments-0.27.0.rc1 app/views/decidim/comments/comments/index.js.erb