关联成员能多次添加

This commit is contained in:
cxt 2016-06-28 16:30:33 +08:00
parent cbe34ea0a7
commit 4983d5283b
1 changed files with 5 additions and 5 deletions

View File

@ -8,19 +8,19 @@ $("#all_students_list").empty();
$("#all_students_list").append(link);
var str = $("#group_member_ids").val();
/*var str = "";
var choose_str = "";
var lists = $("#choose_students_list li");
if(lists.length > 0) {
for(var i=0; i<lists.length; i++) {
var id = $(lists[i]).attr("id").replace(/[^0-9]/ig,"");
str += id;
choose_str += id;
if (i != lists.length -1) {
str += ",";
choose_str += ",";
}
}
}*/
}
<% if user.id.to_i != User.current.id.to_i && (@commit_student_ids.find{|e| e.to_i == user.id.to_i}).nil? && user.member_of_course?(@course) %>
if (str.indexOf(<%=user.id.to_s %>) < 0) {
if (str.indexOf(<%=user.id.to_s %>) < 0 && choose_str.indexOf(<%=user.id.to_s %>) < 0) {
$("#student_<%=user.id %>").one("click",function choose_student() {
var li = "<li id='choose_student_<%=user.id %>'";
<% if user.id.to_i != User.current.id.to_i %>