Fix update announcement setting bug.

This commit is contained in:
BoHung Chiu 2020-08-03 16:35:08 +08:00
parent 2241862475
commit f531708a5f
1 changed files with 14 additions and 12 deletions

View File

@ -110,18 +110,20 @@
}
})
}
var approverList = $(".hidden-approver-list");
$(".approver-check input").on("click",function(){
var el = $(this);
if(el.is(":checked")){
var t = $("<input type='hidden'>");
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 = $("<input type='hidden'>");
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();
}
})
})
</script>
<div id="notification"><%= t("announcement.click_on_submit") %></div>