From f4c19c0fb0224ec09f8171ea9fb2559549316afc Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 11 Sep 2015 10:50:16 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81homework.js=20=20=20on=E6=94=B9?= =?UTF-8?q?=E4=B8=BAlive=202=E3=80=81=E5=AF=BC=E5=85=A5=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E4=B9=8B=E5=90=8E=EF=BC=8C=E7=BC=96=E7=A8=8B=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=B6=88=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/user_select_homework.js.erb | 2 +- public/javascripts/homework.js | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/views/users/user_select_homework.js.erb b/app/views/users/user_select_homework.js.erb index a18fdacc8..acffd2506 100644 --- a/app/views/users/user_select_homework.js.erb +++ b/app/views/users/user_select_homework.js.erb @@ -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(); diff --git a/public/javascripts/homework.js b/public/javascripts/homework.js index c136029bf..773a2c209 100644 --- a/public/javascripts/homework.js +++ b/public/javascripts/homework.js @@ -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(); }); }); \ No newline at end of file