From 9211a7fa456bbd097e568bcdd1912262f3dcddae Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 2 May 2017 09:14:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E6=96=B0=E5=BB=BA=E9=98=B6?= =?UTF-8?q?=E6=AE=B5=E6=97=B6=EF=BC=8C=E7=82=B9=E5=87=BB=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E7=9A=84=E8=AF=9D=EF=BC=8C=E5=BA=94=E8=AF=A5?= =?UTF-8?q?=E5=BF=AB=E9=80=9F=E5=AE=9A=E4=BD=8D=E6=98=BE=E7=A4=BA=E7=AC=AC?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E6=8A=A5=E9=94=99=E7=9A=84=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/challenges/_form.html.erb | 6 ++++++ app/views/games/show.js.erb | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/views/challenges/_form.html.erb b/app/views/challenges/_form.html.erb index 1a59c21b3..ef32f3219 100644 --- a/app/views/challenges/_form.html.erb +++ b/app/views/challenges/_form.html.erb @@ -372,10 +372,13 @@ function challenge_create(){ test_set_whether_lock(); if($('#challenge_subject').val().trim() == ""){ + $("#challenge_subject").focus(); $("#new_shixun_name").show(); }else if($("#challenge_task_pass textarea").val().trim() == ""){ + $("#challenge_task_pass textarea").focus(); $("#new_shixun_pass").show(); }else if($("#challenge_score").val().trim()==""){ + $("#challenge_score").focus(); $("#new_shixun_score").show(); }else{ $('#challenge_shixun_create').submit(); @@ -385,10 +388,13 @@ function challenge_update(){ test_set_whether_lock(); if($('#challenge_subject').val().trim() == ""){ + $("#challenge_subject").focus(); $("#new_shixun_name").show(); }else if($("#challenge_task_pass textarea").val().trim() == ""){ + $("#challenge_task_pass textarea").focus(); $("#new_shixun_pass").show(); }else if($("#challenge_score").val().trim()==""){ + $("#challenge_score").focus(); $("#new_shixun_score").show(); }else{ $('#edit_challenge_<%= @challenge.id %>').submit(); diff --git a/app/views/games/show.js.erb b/app/views/games/show.js.erb index 2e9af71ff..f6332a61e 100644 --- a/app/views/games/show.js.erb +++ b/app/views/games/show.js.erb @@ -1,4 +1,4 @@ -clearInterval(cm); +clearInterval(cm); // tpi关闭耗时 $("#game_show_content").html('<%= escape_javascript(render :partial => 'games/game_show') %>'); $("#myshixun_top").html('<%= escape_javascript(render :partial => 'myshixuns/myshixun_top') %>'); $("#current_task_tab").attr('href','<%= myshixun_game_path(@myshixun.current_task, :myshixun_id => @myshixun) %>');