scinote-web/app/views/reports/new/modal/_step_contents.html.erb

20 lines
702 B
Text
Raw Normal View History

2016-02-12 23:52:43 +08:00
<%= bootstrap_form_tag remote: true, url: step_contents_project_reports_path(project, format: :json), method: :post, html: { id: "add-contents-form" } do |f| %>
<%= hidden_field_tag :id, step.id %>
<%= render partial: "reports/new/modal/step_contents_inner.html.erb", locals: { form: f, step: step } %>
<% end %>
<script type="javascript">
$(function() {
var form = $("#add-contents-form");
var checkAll = form.find("#_step_content_all");
var others = form.find("input:checkbox:not(#_step_content_all)");
2016-02-12 23:52:43 +08:00
checkAll.click(function() {
others.prop("checked", this.checked);
});
others.click(function() {
checkAll.prop("checked", false);
});
});
</script>