30 lines
966 B
JavaScript
30 lines
966 B
JavaScript
$(function() {
|
|
$("#search_not_collaborators").live('input', function (e) {
|
|
throttle(search_not_teacher_f, window, e);
|
|
});
|
|
});
|
|
|
|
var lastteSearchCondition = '';
|
|
function search_not_teacher_f(e){
|
|
if($(e.target).val().trim() == "" || ($(e.target).val().trim() == lastteSearchCondition && lastteSearchCondition != ''))
|
|
{
|
|
return;
|
|
}
|
|
lastteSearchCondition = $(e.target).val().trim();
|
|
$.ajax({
|
|
url: '/shixuns/' + $("#shixun_collaborators_id").val() + '/add_collaborators',
|
|
type:'post',
|
|
data: {is_observe:true, search:e.target.value},
|
|
success: function(data){ }
|
|
});
|
|
}
|
|
|
|
function submit_add_collaborators_form(){
|
|
if($("input[name='membership[user_ids][]']:checked").length >= 1){
|
|
$("#add_teacher_notice").html("").hide();
|
|
$("#add_collaborators_form").submit();
|
|
hideModal();
|
|
}else{
|
|
$("#add_teacher_notice").html("请至少选择一个用户").show();
|
|
}
|
|
} |