Sha256: 0d9c56a9a7bf1361115b795da00e6e7b58378256e89e5174ef95629debe7a0eb

Contents?: true

Size: 814 Bytes

Versions: 19

Compression:

Stored size: 814 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 %>';
  $comments.replaceWith(commentsHtml);

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

  // 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

19 entries across 19 versions & 1 rubygems

Version Path
decidim-comments-0.26.10 app/views/decidim/comments/comments/reload.js.erb
decidim-comments-0.26.9 app/views/decidim/comments/comments/reload.js.erb
decidim-comments-0.26.8 app/views/decidim/comments/comments/reload.js.erb
decidim-comments-0.26.7 app/views/decidim/comments/comments/reload.js.erb
decidim-comments-0.26.5 app/views/decidim/comments/comments/reload.js.erb
decidim-comments-0.26.4 app/views/decidim/comments/comments/reload.js.erb
decidim-comments-0.26.3 app/views/decidim/comments/comments/reload.js.erb
decidim-comments-0.26.2 app/views/decidim/comments/comments/reload.js.erb
decidim-comments-0.26.1 app/views/decidim/comments/comments/reload.js.erb
decidim-comments-0.26.0 app/views/decidim/comments/comments/reload.js.erb
decidim-comments-0.26.0.rc2 app/views/decidim/comments/comments/reload.js.erb
decidim-comments-0.26.0.rc1 app/views/decidim/comments/comments/reload.js.erb
decidim-comments-0.25.2 app/views/decidim/comments/comments/reload.js.erb
decidim-comments-0.25.1 app/views/decidim/comments/comments/reload.js.erb
decidim-comments-0.25.0 app/views/decidim/comments/comments/reload.js.erb
decidim-comments-0.25.0.rc4 app/views/decidim/comments/comments/reload.js.erb
decidim-comments-0.25.0.rc3 app/views/decidim/comments/comments/reload.js.erb
decidim-comments-0.25.0.rc2 app/views/decidim/comments/comments/reload.js.erb
decidim-comments-0.25.0.rc1 app/views/decidim/comments/comments/reload.js.erb