增加课程讨论区/项目讨论展开更多功能

博客列表页面展开更多
统一展开高度为一个屏幕
This commit is contained in:
huang 2016-01-05 12:59:59 +08:00
parent 0d6ad9ffac
commit 1f09817e4d
7 changed files with 52 additions and 35 deletions

View File

@ -57,13 +57,14 @@
<div class="homepagePostDate">
发帖时间:<%= format_time(activity.created_on) %>
</div>
<div class="homepagePostIntro break_word upload_img list_style" id="activity_description_<%= user_activity_id%>">
<% if activity.parent_id.nil? %>
<%= activity.content.to_s.html_safe%>
<% else %>
<%= activity.parent.content.to_s.html_safe%>
<% end %>
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
<div id="intro_content_<%= user_activity_id%>">
<% if activity.parent_id.nil? %>
<%= activity.content.to_s.html_safe%>
<% else %>
<%= activity.parent.content.to_s.html_safe%>
<% end %>
</div>
</div>
<div class="cl"></div>
<div class=" fl" style="width: 600px">
@ -72,6 +73,11 @@
<%= render :partial => 'blog_comments/attachments_links', :locals => {:attachments => activity.attachments, :options => options, :is_float => true} %>
<% end %>
</div>
<div class="cl"></div>
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div>
<div class="homepagePostSetting" id="act-<%= user_activity_id %>" style="visibility: hidden">
<ul>
<li class="homepagePostSettingIcon">

View File

@ -76,15 +76,21 @@
$(function () {
init_activity_KindEditor_data(<%= topic.id%>, null, "87%", "<%=topic.class.to_s%>");
showNormalImage('activity_description_<%= topic.id %>');
/*var description_images=$("div#activity_description_<%#= topic.id %>").find("img");
if (description_images.length>0) {
for (var i=0; i<description_images.length; i++){
var image=$(description_images[i]);
var element=$("<a></a>").attr("href",image.attr('src'));
image.wrap(element);
}
}
$('#activity_description_<%#= topic.id %> a').colorbox({rel:'nofollow', close: "关闭", returnFocus: false});*/
if($("#intro_content_<%= topic.id %>").height() > 360) {
$("#intro_content_show_<%= topic.id %>").show();
}
$("#intro_content_show_<%= topic.id %>").click(function(){
$("#activity_description_<%= topic.id %>").toggleClass("maxh360");
$("#activity_description_<%= topic.id%>").toggleClass("lh18");
$("#intro_content_show_<%= topic.id %>").hide();
$("#intro_content_hide_<%= topic.id %>").show();
});
$("#intro_content_hide_<%= topic.id %>").click(function(){
$("#activity_description_<%= topic.id %>").toggleClass("maxh360");
$("#activity_description_<%= topic.id%>").toggleClass("lh18");
$("#intro_content_hide_<%= topic.id %>").hide();
$("#intro_content_show_<%= topic.id %>").show();
});
});
</script>
<% if topic %>

View File

@ -41,15 +41,21 @@
$(function () {
init_activity_KindEditor_data(<%= topic.id%>, null, "87%");
showNormalImage('activity_description_<%= topic.id %>');
/*var description_images=$("div#activity_description_<%#= topic.id %>").find("img");
if (description_images.length>0) {
for (var i=0; i<description_images.length; i++){
var image=$(description_images[i]);
var element=$("<a></a>").attr("href",image.attr('src'));
image.wrap(element);
}
}
$('#activity_description_<%#= topic.id %> a').colorbox({rel:'nofollow', close: "关闭", returnFocus: false});*/
if($("#intro_content_<%= topic.id %>").height() > 360) {
$("#intro_content_show_<%= topic.id %>").show();
}
$("#intro_content_show_<%= topic.id %>").click(function(){
$("#activity_description_<%= topic.id %>").toggleClass("maxh360");
$("#activity_description_<%= topic.id%>").toggleClass("lh18");
$("#intro_content_show_<%= topic.id %>").hide();
$("#intro_content_hide_<%= topic.id %>").show();
});
$("#intro_content_hide_<%= topic.id %>").click(function(){
$("#activity_description_<%= topic.id %>").toggleClass("maxh360");
$("#activity_description_<%= topic.id%>").toggleClass("lh18");
$("#intro_content_hide_<%= topic.id %>").hide();
$("#intro_content_show_<%= topic.id %>").show();
});
});
</script>
<% if topic %>

View File

@ -216,8 +216,8 @@ a.menuGrey:hover {color:#fe7d68;}
#navSearchAlert {display:none;}
.homepagePostReplyjournal{margin-left: 15px; float: left;}
.lh18 {line-height: 18px;}
.maxh360 {max-height: 360px;}
/*.lh18 {line-height: 18px;}*/
/*.maxh360 {max-height: 360px;}*/
/*邮件邀请*/
.box_main{ width:345px; margin:0 auto;}

View File

@ -706,7 +706,8 @@ a.gz_btn{display:block; background:url(../images/pic_uersall.png) -318px -25px n
a:hover.gz_btn{ color:#ff5722;}
.homepagePostReplyjournal{margin-left: 15px; float: left;}
.lh18 {line-height: 18px;}
.maxh360 {max-height: 360px;}
/*该高度会写入配置文件*/
.maxh360 {max-height: 760px;}
.courseMenu {width:30px; display:block; float:right;height: 50px;}
.courseMenuIcon {display:inline-block; background:url(../images/homepage_icon2.png) -190px -365px no-repeat; width:15px; height:15px; margin-top: 16px; margin-right: 15px; position: relative;line-height:0;}

View File

@ -962,12 +962,6 @@ a:hover.Reply_pic{border:1px solid #64bdd9;}
margin-bottom: 5px;
font-weight: bold;
}
.maxh360 {
max-height: 360px;
}
.lh18 {
line-height: 18px;
}
.homepagePostIntro {
font-size: 14px;
color: #484848;

View File

@ -956,4 +956,8 @@ span.at {color:#269ac9;}
.sectionContent li:hover {background-color:#cccccc;}
.sectionContent span {width:160px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:inline-block; height:20px; vertical-align:top;}
.orgDirection {width:392px; background-color:#f1f1f1; height:30px; vertical-align:middle; line-height:30px; color:#585858; padding-left:10px;}
.orgSendSearch {border:1px solid #dddddd; outline:none; width:262px; height:22px; padding-left:10px; float:left;}
.orgSendSearch {border:1px solid #dddddd; outline:none; width:262px; height:22px; padding-left:10px; float:left;}
/*文本描述展开高度*/
.maxh360 {max-height: 760px;}
.lh18 { line-height: 18px;}