Sha256: d180ab8dc3e4db32c9de4081236b12ed392f63d68cafe89acbc7ce8c43d9184e

Contents?: true

Size: 652 Bytes

Versions: 9

Compression:

Stored size: 652 Bytes

Contents

var commontatorOldCommentIds = $("#commontator-comment-<%=
  @comment.id
%>-children").children().map(function() {
  return '#' + $(this).attr('id');
}).toArray().join(',');

<%=
  render partial: 'show', locals: {
    user: @commontator_user,
    thread: @commontator_thread,
    comment: @comment,
    page: @commontator_page,
    show_all: @commontator_show_all
  }
%>

var commontatorNewComments = $("#commontator-comment-<%=
  @comment.id
%>-children").children().not(commontatorOldCommentIds).hide().fadeIn();
$('html, body').animate(
  { scrollTop: commontatorNewComments.offset().top - window.innerHeight/2 }, 'fast'
);

<%= javascript_proc %>

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
commontator-7.0.1 app/views/commontator/comments/show.js.erb
commontator-7.0.0 app/views/commontator/comments/show.js.erb
commontator-6.3.2 app/views/commontator/comments/show.js.erb
commontator-6.3.1 app/views/commontator/comments/show.js.erb
commontator-6.3.0 app/views/commontator/comments/show.js.erb
commontator-6.2.1 app/views/commontator/comments/show.js.erb
commontator-6.2.0 app/views/commontator/comments/show.js.erb
commontator-6.1.1 app/views/commontator/comments/show.js.erb
commontator-6.1.0 app/views/commontator/comments/show.js.erb