diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb
index 91467cad4..438c6f8ee 100644
--- a/app/controllers/games_controller.rb
+++ b/app/controllers/games_controller.rb
@@ -67,7 +67,7 @@ class GamesController < ApplicationController
shixun_new_commit = g.commits(@myshixun.shixun.try(:gpid)).first.try(:id)
@myshixun.update_column(:commit_id, shixun_new_commit)
sleep(2) # g
- render :json => {status:200}
+ render :json => {:status => 200}
end
def index
diff --git a/app/views/games/_game_show.html.erb b/app/views/games/_game_show.html.erb
index 508fcb197..ff1cc5a9d 100644
--- a/app/views/games/_game_show.html.erb
+++ b/app/views/games/_game_show.html.erb
@@ -121,7 +121,8 @@
关卡任务的代码文件有更新,点击立即更新获取最新代码!
- <%= link_to "立即更新", sync_codes_myshixun_game_path(@game, :myshixun_id => @myshixun), :remote => true, :class => "fl color-orange03", :onclick => "hide_tip_content();" %>
+ <%#= link_to "立即更新", sync_codes_myshixun_game_path(@game, :myshixun_id => @myshixun), :remote => true, :class => "fl color-orange03", :onclick => "sync_hide_tip_content();" %>
+
立即更新
稍后再说
@@ -199,14 +200,26 @@
var praiseStatus = <%= @praise.nil? ? false : true %>; // 是否点赞
var treadStatus = <%= @tread.nil? ? false : true %>; // 是否踩
- //显示更新提示方法
+ // 显示更新提示方法
function show_tip_content(){
$(".tip-panel-animate").addClass("animate-tip");
$(".tip-panel-animate").show();
}
- //隐藏更新提示方法
- function hide_tip_content(){
+
+ // 隐藏更新提示方法
+ function sync_hide_tip_content(){
$(".tip-panel-animate").addClass("animate-tip-hide");
setTimeout('$(".tip-panel-animate").hide();', 700);
+ alert("test");
+ $.ajax({
+ url: "<%= sync_codes_myshixun_game_path(@game, :myshixun_id => @myshixun) %>",
+ dataType: "script",
+ success: function(data){
+ alert(data.status);
+ if(data.status == 200){
+ $('#'+target).html(data);
+ }
+ }
+ })
}
\ No newline at end of file