Files
old-holivud2/app/views/video_release_confirmations/create.js.erb
2020-05-31 22:38:19 +02:00

21 lines
1000 B
Plaintext

var hideConfirmed = $("input[name=hide_confirmed]:checked").length > 0;
// Mark the release as confirmed
if (<%= @releasable.respond_to?(:file_infos) %>) {
$("[data-ujs-target=<%= dom_id(@releasable, "file_info_#{@video_release_confirmation.file_info_id}") %>]").attr("data-confirmed", true).data("confirmed", true)
} else {
$("#<%= dom_id(@releasable) %>").attr("data-confirmed", true).data("confirmed", true)
}
// Hide if necessary
$("#appearance_releases_section #<%= dom_id(@releasable) %>").attr("data-hidden", hideConfirmed).data("hidden", hideConfirmed);
// Refresh the confirmed releases list
$("#video_release_confirmations").html("<%= j render("video_analyses/video_release_confirmations", video_release_confirmations: @video_release_confirmations) %>");
// Close and remove the modal
$("#new_video_release_confirmation_modal").on("hidden.bs.modal", function (e) {
$("#new_video_release_confirmation_modal").remove();
});
$("#new_video_release_confirmation_modal").modal("hide");