From be9cf478e540b28b5b4c69af1339be6c0c1e16a9 Mon Sep 17 00:00:00 2001 From: yutao <283765470@qq.com> Date: Wed, 24 Jun 2015 15:39:16 +0800 Subject: [PATCH 1/2] =?UTF-8?q?bug#2911:=E7=94=A8=E8=B6=85=E7=BA=A7?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E8=BF=9B=E5=85=A5admin=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E7=AA=97=E5=8F=A3=EF=BC=8C=E7=82=B9=E5=87=BB=E8=BF=9B?= =?UTF-8?q?=E5=85=A5=E2=80=9C=E7=94=A8=E6=88=B7=E5=88=97=E8=A1=A8=E2=80=9D?= =?UTF-8?q?=EF=BC=8C=E6=90=9C=E7=B4=A2=E6=9F=90=E7=94=A8=E6=88=B7=EF=BC=8C?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E8=AF=A5=E7=94=A8=E6=88=B7=EF=BC=8C=E5=A6=82?= =?UTF-8?q?=E5=9B=BE=EF=BC=8C=E7=94=A8=E6=88=B7=E5=8A=A8=E6=80=81=E4=B8=AD?= =?UTF-8?q?=E5=AD=97=E8=A2=AB=E6=88=AA=E6=96=AD=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_preferences.html.erb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/views/users/_preferences.html.erb b/app/views/users/_preferences.html.erb index 995e2076e..bad60c963 100644 --- a/app/views/users/_preferences.html.erb +++ b/app/views/users/_preferences.html.erb @@ -1,6 +1,9 @@ + <%= labelled_fields_for :pref, @user.pref do |pref_fields| %> -

<%= pref_fields.check_box :hide_mail %>

-

<%= pref_fields.time_zone_select :time_zone, nil, :include_blank => true %>

-

<%= pref_fields.select :comments_sorting, [[l(:label_chronological_order), 'asc'], [l(:label_reverse_chronological_order), 'desc']] %>

+

<%= pref_fields.check_box :hide_mail %>

+

<%= pref_fields.time_zone_select :time_zone, nil, :include_blank => true %>

+

<%= pref_fields.select :comments_sorting, [[l(:label_chronological_order), 'asc'], [l(:label_reverse_chronological_order), 'desc']] %>

<% end %> From c92bd138bb3423bf7c6e97caf98fb130f73a7b4b Mon Sep 17 00:00:00 2001 From: yutao <283765470@qq.com> Date: Wed, 24 Jun 2015 16:12:45 +0800 Subject: [PATCH 2/2] =?UTF-8?q?bug#2915:=E6=AD=A3=E5=BC=8F=E7=89=88?= =?UTF-8?q?=E2=80=94=E9=A1=B9=E7=9B=AE=E8=AE=A8=E8=AE=BA=E5=8C=BA=EF=BC=9A?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E5=86=85=E5=AE=B9=E8=BF=87=E5=A4=9A=E4=B8=94?= =?UTF-8?q?=E5=B8=A6=E6=9C=89=E8=A1=A8=E6=83=85=E6=97=B6=EF=BC=8C=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=B8=8D=E5=AE=8C=E6=95=B4=EF=BC=8C=E4=B9=9F=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=B1=95=E5=BC=80=E6=8F=90=E7=A4=BA=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/boards/_course_show.html.erb | 27 ++++++++++++++++--------- app/views/boards/_project_show.html.erb | 27 ++++++++++++++++--------- 2 files changed, 36 insertions(+), 18 deletions(-) diff --git a/app/views/boards/_course_show.html.erb b/app/views/boards/_course_show.html.erb index 7eed593d9..417a5a8ba 100644 --- a/app/views/boards/_course_show.html.erb +++ b/app/views/boards/_course_show.html.erb @@ -70,26 +70,35 @@ //解决由于图片加载慢造成div高度不够 以至于展开按钮不显示的bug $(function(){ function nh_show_btn(){ - if($("#contentmessage<%=topic.id %>").height()>182){ - $("#project_show_<%= topic.id%>").show(); + if($("#project_show_<%= topic.id%>").is(':hidden')){ + if($("#contentmessage<%=topic.id %>").height()>182){ + $("#project_show_<%= topic.id%>").show(); + } } } var div = $("#contentmessage<%=topic.id %>"); var imgs = $('img',div); var lens = imgs.length; function nh_load_img_end(){ - lens--; - if(lens <= 0){ - nh_show_btn(); - } - } - if(lens <= 0){ nh_show_btn(); - }else{ +// lens--; +// if(lens <= 0){ +// nh_show_btn(); +// } + } + if(lens > 0){ $('img',div).load(function(){ nh_load_img_end(); }); } + nh_show_btn(); +// if(lens <= 0){ +// nh_show_btn(); +// }else{ +// $('img',div).load(function(){ +// nh_load_img_end(); +// }); +// } });
diff --git a/app/views/boards/_project_show.html.erb b/app/views/boards/_project_show.html.erb index bb36c6f19..03d283031 100644 --- a/app/views/boards/_project_show.html.erb +++ b/app/views/boards/_project_show.html.erb @@ -62,26 +62,35 @@ //解决由于图片加载慢造成div高度不够 以至于展开按钮不显示的bug $(function(){ function nh_show_btn(){ - if($("#contentmessage<%=topic.id %>").height()>182){ - $("#project_show_<%= topic.id%>").show(); + if($("#project_show_<%= topic.id%>").is(':hidden')){ + if($("#contentmessage<%=topic.id %>").height()>182){ + $("#project_show_<%= topic.id%>").show(); + } } } var div = $("#contentmessage<%=topic.id %>"); var imgs = $('img',div); var lens = imgs.length; function nh_load_img_end(){ - lens--; - if(lens <= 0){ - nh_show_btn(); - } - } - if(lens <= 0){ nh_show_btn(); - }else{ +// lens--; +// if(lens <= 0){ +// nh_show_btn(); +// } + } + if(lens > 0){ $('img',div).load(function(){ nh_load_img_end(); }); } + nh_show_btn(); +// if(lens <= 0){ +// nh_show_btn(); +// }else{ +// $('img',div).load(function(){ +// nh_load_img_end(); +// }); +// } });