// Mark the release as no longer confirmed and show
if (<%= @releasable.respond_to?(:file_infos) && @video_release_confirmation.respond_to?(:file_info_id) %>) {
  if (<%= @video_release_confirmations.none? { |video_release_confirmation| video_release_confirmation.respond_to?(:file_info_id) && video_release_confirmation.file_info_id == @video_release_confirmation.file_info_id } %>) {
    $("[data-ujs-target=<%= dom_id(@releasable, "file_info_#{@video_release_confirmation.file_info_id}") %>]")
      .attr("data-confirmed", false).data("confirmed", false)
      .attr("data-hidden", false).data("hidden", false);
  }
} else {
  if (<%= @video_release_confirmations.none? { |video_release_confirmation| video_release_confirmation.releasable_id == @video_release_confirmation.releasable_id && video_release_confirmation.releasable_type == @video_release_confirmation.releasable_type } %>) {
    $("#<%= dom_id(@releasable) %>")
      .attr("data-confirmed", false).data("confirmed", false)
      .attr("data-hidden", false).data("hidden", false);
  }
}

// Hide any open tooltips before removing elements from the DOM
$("#<%= dom_id(@video_release_confirmation) %> [data-toggle=tooltip]").tooltip("dispose");

// Refresh the confirmed releases list
$("#video_release_confirmations").html("<%= j render("video_analyses/video_release_confirmations", video_release_confirmations: @video_release_confirmations) %>");
