diff --git a/app/views/admin/announcements/settings.html.erb b/app/views/admin/announcements/settings.html.erb index 8d66b22..c22115c 100644 --- a/app/views/admin/announcements/settings.html.erb +++ b/app/views/admin/announcements/settings.html.erb @@ -110,18 +110,20 @@ } }) } - var approverList = $(".hidden-approver-list"); - $(".approver-check input").on("click",function(){ - var el = $(this); - if(el.is(":checked")){ - var t = $(""); - t.val(el.val()); - t.attr("name", "announcement_setting[approvers][]"); - t.attr("id", "check_" + el.val()); - approverList.append(t); - }else{ - approverList.find("#check_" + el.val()).remove(); - } + $(document).ready(function(){ + var approverList = $(".hidden-approver-list"); + $(".approver-check input").on("click",function(){ + var el = $(this); + if(el.is(":checked")){ + var t = $(""); + t.val(el.val()); + t.attr("name", "announcement_setting[approvers][]"); + t.attr("id", "check_" + el.val()); + approverList.append(t); + }else{ + approverList.find("#check_" + el.val()).remove(); + } + }) })