$('#comments-box-<%= annotation.id %> a.publish-comment').on({
  click: function(e) {
    e.preventDefault();
    $('a.publish-comment').hide();
    $('#js-comment-form-annotation-<%= annotation.id %>').toggle();
    $('#js-comment-form-annotation-<%= annotation.id %> textarea').focus();
    return;
  }
});

<% if comment.errors.any? %>
  $('#comments-box-<%= @annotation.id %> a.publish-comment').hide();
  $('#js-comment-form-annotation-<%= annotation.id %>').toggle();
  $('#js-comment-form-annotation-<%= annotation.id %> textarea').focus();
<% end %>
