From 4f342142e6f87caf7805d22bea5ae32fb4d2f184 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 24 Jun 2016 17:58:50 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=96=87=E7=AB=A0=E7=9A=84?= =?UTF-8?q?=E5=B1=95=E5=BC=80=E6=9B=B4=E5=A4=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_reply_banner.html.erb | 2 +- public/javascripts/application.js | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/app/views/users/_reply_banner.html.erb b/app/views/users/_reply_banner.html.erb index 0d7e0b2bd..25175542f 100644 --- a/app/views/users/_reply_banner.html.erb +++ b/app/views/users/_reply_banner.html.erb @@ -10,7 +10,7 @@
<%#= format_date(activity.updated_on) %>
<%if count>3 %>
- + 展开更多
diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 06304a8b0..a04df39ac 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -1290,7 +1290,24 @@ function clear_data(k,mdu){ } } -function expand_reply(container, btnid, id, type, div_id) { +function expand_reply(container,btnid){ + var target = $(container).children(); + var btn = $(btnid); + if(btn.data('init')=='0'){ + btn.data('init',1); + btn.html('收起回复'); + target.show(); + }else{ + btn.data('init',0); + btn.html('展开更多'); + target.hide(); + target.eq(0).show(); + target.eq(1).show(); + target.eq(2).show(); + } +} + +function expand_all_reply(container, btnid, id, type, div_id) { var target = $(container); var btn = $(btnid); if (btn.data('init') == '0') {