otwarchive-symphonyarchive/app/views/comments/cancel_comment_edit.js.erb

12 lines
616 B
Text
Raw Permalink Normal View History

2026-03-11 22:22:11 +00:00
<% comment_field_id = "#comment_#{@comment.id}" %>
/* roll up the comment form */
$j("<%= comment_field_id %>").slideUp();
/* render the comment again
must use replaceWith() rather than html() because the single_comment partial already contains the comment li
and we would end up with li within li for the same comment
*/
$j("<%= comment_field_id %>").replaceWith("<%= escape_javascript(render :partial => "comments/single_comment",
:locals => {:single_comment => @comment, :commentable => @comment.commentable}) %>");
/* roll down the comment */
$j("<%= comment_field_id %>").slideDown();