diff --git a/app/views/courses/delete_member.js.erb b/app/views/courses/delete_member.js.erb index 89588f4c1..4e31a87c1 100644 --- a/app/views/courses/delete_member.js.erb +++ b/app/views/courses/delete_member.js.erb @@ -1,5 +1,9 @@ hideModal(); -$("#member_li_<%=params[:member_id] %>").html(""); +var all_indexes = $("#member_li_<%=params[:member_id] %>").nextAll().find("td:first-child"); +for(var i = 0; i < all_indexes.length; i++){ + $(all_indexes[i]).html(parseInt($(all_indexes[i]).html()) - 1); +} +$("#member_li_<%=params[:member_id] %>").remove(); $("#st_groups").html("<%=escape_javascript(render :partial => 'new_groups_name', :locals => {:course_groups => @course_groups}) %>"); $("#group_children_list").html("<%= escape_javascript( render :partial => 'layouts/group_children_list', :locals => {:course => @course})%>"); $("#student_number").html("<%= studentCount(@course) %>");