Skip to content
Snippets Groups Projects
Commit 8cd17b3f authored by PavelBegunkov's avatar PavelBegunkov
Browse files

...

parent 43c2dfec
Branches
Tags
No related merge requests found
......@@ -3,37 +3,27 @@ $(function() {
var SelectDepartment = $('select.SelectDepartment');
var InputNameFilter = $('input.InputTeacherName');
var SelectFaculty = $('select.SelectFaculty');
CallSearchTeachers();
var teacherPrototype = $($.parseHTML(
'<div class="Teacher" id="0">\
<button class="Action"></button>\
<div class="Name"></div>\
<button class="Action"></button>\
</div>'
));
// Добавить преподавателя
function AddTeacher(ID, Name, Action){
var cell = teacherPrototype.clone();
cell.filter('div.Teacher').prop('id', ID);
var temp = cell.filter('button.Action');
cell.prop('id', ID);
cell.find('div.Name').html(Name);
var temp = cell.find('button.Action');
temp.addClass('Action_'+Action+'Teacher');
if (Action == 'Unbind')
temp.val('Отсоединить');
temp.html('Отсоединить');
else if (Action == 'Bind')
temp.val('Присоединить');
$r = '\
<div class="Teacher" id="'+ ID +'">\
<div class="Name">'+ Name +'</div>';
if (Action == 'Unbind')
$r += '<button class="Action_UnbindTeacher Action">Отсоединить</button>';
if (Action == 'Bind')
$r += '<button class="Action_BindTeacher Action">Присоединить</button>';
$r += '\
</div>';
return $r;
temp.html('Присоединить');
return cell;
}
......@@ -89,8 +79,7 @@ SelectFaculty.change(function(){
SelectDepartment.html('<option value="0">Нет кафедр</option>');
}
SelectDepartment.removeAttr('disabled');
InputNameFilter.removeAttr('disabled');
CallSearchTeachers();
InputNameFilter.removeAttr('disabled');
}
);
});
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment