Sha256: 4bf1f01b58e01a6164a4f5e0ae09f489ef2af0146e1d300afd905b7b53a18efe

Contents?: true

Size: 833 Bytes

Versions: 18

Compression:

Stored size: 833 Bytes

Contents

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

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

  var commentsHtml = '<%== j(render partial: "comments").strip %>';
  $(".loading-comments").addClass("hidden");
  $comments.replaceWith(commentsHtml);

  $comments = $("#" + rootCommentableId);

  // Re-create the component
  component = new Decidim.CommentsComponent($comments, $comments.data("decidim-comments"));
  component.mountComponent();
  $comments.data("comments", component);

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

  Decidim.addInputEmoji();
}());

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
decidim-comments-0.30.0.rc3 app/views/decidim/comments/comments/reload.js.erb
decidim-comments-0.30.0.rc2 app/views/decidim/comments/comments/reload.js.erb
decidim-comments-0.30.0.rc1 app/views/decidim/comments/comments/reload.js.erb
decidim-comments-0.29.2 app/views/decidim/comments/comments/reload.js.erb
decidim-comments-0.28.5 app/views/decidim/comments/comments/reload.js.erb
decidim-comments-0.29.1 app/views/decidim/comments/comments/reload.js.erb
decidim-comments-0.28.4 app/views/decidim/comments/comments/reload.js.erb
decidim-comments-0.29.0 app/views/decidim/comments/comments/reload.js.erb
decidim-comments-0.28.3 app/views/decidim/comments/comments/reload.js.erb
decidim-comments-0.29.0.rc4 app/views/decidim/comments/comments/reload.js.erb
decidim-comments-0.29.0.rc3 app/views/decidim/comments/comments/reload.js.erb
decidim-comments-0.29.0.rc2 app/views/decidim/comments/comments/reload.js.erb
decidim-comments-0.29.0.rc1 app/views/decidim/comments/comments/reload.js.erb
decidim-comments-0.28.2 app/views/decidim/comments/comments/reload.js.erb
decidim-comments-0.28.1 app/views/decidim/comments/comments/reload.js.erb
decidim-comments-0.28.0 app/views/decidim/comments/comments/reload.js.erb
decidim-comments-0.28.0.rc5 app/views/decidim/comments/comments/reload.js.erb
decidim-comments-0.28.0.rc4 app/views/decidim/comments/comments/reload.js.erb