From e3ce07dacc70e8b5d7bdd08b848e332d7644ecb5 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 31 Aug 2017 16:25:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E8=B7=AF=E5=BE=84=E4=B8=AD?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=AE=9E=E8=AE=AD=E5=BC=B9=E5=87=BA=E6=96=B0?= =?UTF-8?q?=E7=9A=84=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/shixuns/operation.js.erb | 13 +++++++++---- public/loading.html | 14 ++++++++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 public/loading.html diff --git a/app/views/shixuns/operation.js.erb b/app/views/shixuns/operation.js.erb index c1ebe2f8f..04f7c8c98 100644 --- a/app/views/shixuns/operation.js.erb +++ b/app/views/shixuns/operation.js.erb @@ -2,13 +2,18 @@ sure_box_redirect('#{security_settings_path}', '开启实训,请先绑定邮箱'); <% else %> <% if @is_modify.blank? %> - //为了防止浏览器阻挡 + //为了防止浏览器阻挡,在实训路径中需要弹出新的页面,而实训首页又不需要弹出新的页面 + <% if @is_subject %> + var newTab=window.open("/loading.html"); + $.ajax().done(function() { + // 重定向到目标页面 + newTab.location.href = "<%= shixun_exec_shixun_path(@shixun) %>"; + }); + <% else %> $(".loading_all").show(); window.location.href="<%= shixun_exec_shixun_path(@shixun) %>"; $("#ajax-indicator").hide(); - //var tempwindow = window.open(); - //tempwindow.location = '<%#= shixun_exec_shixun_path(@shixun) %>'; - //window.open("<%#= shixun_exec_shixun_path(@shixun) %>"); + <% end %> <% else %> sure_box_redirect('<%= myshixun_reset_myshixun_path(@myshixun) %>', '实训已经更新啦,系统正在为您重置'); <% end %> diff --git a/public/loading.html b/public/loading.html new file mode 100644 index 000000000..7d3df7457 --- /dev/null +++ b/public/loading.html @@ -0,0 +1,14 @@ + +
+
+
EDUCODER
+

LOADING

+
+
\ No newline at end of file