From 48b38f32bb7958df611d467943b3f1cd8ca39310 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 18 Jul 2019 11:13:19 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AB=9E=E8=B5=9B=E5=BC=B9=E7=AA=97=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_unlogin_header.html.erb | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/app/views/layouts/_unlogin_header.html.erb b/app/views/layouts/_unlogin_header.html.erb index e466ef2a..ab5adc0e 100644 --- a/app/views/layouts/_unlogin_header.html.erb +++ b/app/views/layouts/_unlogin_header.html.erb @@ -94,14 +94,16 @@ document.getElementById('nHeader').style.left=sl+'px'; }; + $(function() { + if (window.localStorage) { + var uid = localStorage.getItem('competition_uid'); + } else { + var uid = false + } + if(!uid){ + var htmlvalue = "<%= escape_javascript(render :partial => 'competitions/competitions_name')%>"; + pop_box_new(htmlvalue, 500, 380); + } + }) - if (window.localStorage) { - var uid = localStorage.getItem('competition_uid'); - } else { - var uid = false - } - if(!uid){ - var htmlvalue = "<%= escape_javascript(render :partial => 'competitions/competitions_name')%>"; - pop_box_new(htmlvalue, 500, 380); - } \ No newline at end of file