1、homework.js on改为live

2、导入作业之后,编程功能按钮消失
This commit is contained in:
sw 2015-09-11 10:50:16 +08:00
parent 527ff41d43
commit f4c19c0fb0
2 changed files with 10 additions and 10 deletions

View File

@ -3,6 +3,6 @@ hideModal('#coursesChoosePopup');
$("#homework_name").val("<%= @homework.name%>");
$("#homework_end_time").val("<%= @homework.end_time%>");
$("#course_id").val("<%= @homework.course_id%>");
$("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => { :container => @homework })%>");
$("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => { :container => @homework,:has_program => true })%>");
homework_description_editor.html("<%= escape_javascript(@homework.description.html_safe)%>");
$("#homework_editor").show();

View File

@ -58,10 +58,10 @@ $(function(){
);
};
$('#test-program-btn').on('click', test_program);
$('#test-program-btn').live('click', test_program);
$('#commit-program-work-btn').on('click', function(){
$('#commit-program-work-btn').live('click', function(){
if(!valid_form()){
return;
}
@ -89,7 +89,7 @@ $(function(){
$(".HomeWorkCon form").submit();
});
$('form.edit_student_work').on('keydown', '#program-src', function(){
$('form.edit_student_work').live('keydown', '#program-src', function(){
tested = false;
});
@ -104,12 +104,12 @@ $(function(){
$('input.date-input').datepicker(datepickerOptions);
$('a.pic_date').on('click', function(){
$('a.pic_date').live('click', function(){
$(this).parent().prev().first().focus();
})
$('a.ProBtn').on('click', function(){
$('a.ProBtn').live('click', function(){
$("#BluePopupBox").dialog({
modal: true,
dialogClass: 'BluePopupBox',
@ -117,12 +117,12 @@ $(function(){
});
$(".ui-dialog-titlebar").hide();
$("a.CloseBtn").on('click', function(){
$("a.CloseBtn").live('click', function(){
$("#BluePopupBox" ).dialog("close");
});
$('#textarea_input_test').focus();
$("#BluePopupBox a.BlueCirBtn").on('click', function(){
$("#BluePopupBox a.BlueCirBtn").live('click', function(){
var test_numbers = 0;
var valid = true;
var input = null;
@ -162,12 +162,12 @@ $(function(){
});
});
$("#BluePopupBox").on('click', 'a.icon_add', function(){
$("#BluePopupBox").live('click', 'a.icon_add', function(){
var html = bt('t:test-answer-list', null);
$(this).parent('.mt10').after(html);
});
$("#BluePopupBox").on('click', 'a.icon_remove', function(){
$("#BluePopupBox").live('click', 'a.icon_remove', function(){
$(this).parent('.mt10').remove();
});
});