个人主页报500、动态显示错位的bug修复

This commit is contained in:
cxt 2015-08-29 10:16:04 +08:00
parent 69178f1522
commit c650c83f82
7 changed files with 17 additions and 17 deletions

View File

@ -649,7 +649,7 @@ class UsersController < ApplicationController
@user_activities = UserActivity.where("container_type = 'Project' and container_id in #{user_project_ids} and act_type = 'Message'").order('created_at desc').limit(10).offset(@page * 10)
else
@user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids}) and act_type in #{course_types}").order('created_at desc').limit(10).offset(@page * 10)
end
end
else
@user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids}) and act_type in #{course_types}").order('created_at desc').limit(10).offset(@page * 10)
end

View File

@ -106,7 +106,7 @@
) if reply.course_destroyable_by?(User.current) %>
<!--<a href="javascript:void(0);" class="replyGrey fr ml10">删除</a>-->
</div>
<div class="homepagePostReplyContent" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="<%= reply.content.html_safe %>"><%= reply.content.html_safe %></div>
<div class="homepagePostReplyContent"><%= reply.content.html_safe %></div>
</div>
<div class="cl"></div>
</li>

View File

@ -83,7 +83,7 @@
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete) %>
<!--<a href="javascript:void(0);" class="replyGrey fr ml10">删除</a>-->
</div>
<div class="homepagePostReplyContent" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="<%= comment.comments.html_safe %>"><%= comment.comments.html_safe %></div>
<div class="homepagePostReplyContent"><%= comment.comments.html_safe %></div>
</div>
<div class="cl"></div>
</li>

View File

@ -119,7 +119,7 @@
<div class="homepagePostReplyContent" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><%= string %></div>
<% end %>
<% else %>
<div class="homepagePostReplyContent" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><%= reply.notes.html_safe %></div>
<div class="homepagePostReplyContent"><%= reply.notes.html_safe %></div>
<% end %>
</div>
<div class="cl"></div>

View File

@ -103,7 +103,7 @@
) if reply.course_destroyable_by?(User.current) %>
<!--<a href="javascript:void(0);" class="replyGrey fr ml10">删除</a>-->
</div>
<div class="homepagePostReplyContent" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="<%= reply.content.html_safe %>"><%= reply.content.html_safe %></div>
<div class="homepagePostReplyContent"><%= reply.content.html_safe %></div>
</div>
<div class="cl"></div>
</li>

View File

@ -3,16 +3,16 @@
<script>
//$(function(){if($("#contentmessage<%#=topic.id %>").height()>182){$("#project_show_<%#= topic.id%>").show();}});
//解决由于图片加载慢造成div高度不够 以至于展开按钮不显示的bug
$(function(){
/*$(function(){
function nh_show_btn(){
if($("#activity_message_<%= user_activity.id%>").is(':hidden')){
if($("#activity_description_<%= user_activity.id%>").height()>120){
$("#activity_description_<%= user_activity.id%>").toggleClass("activity_description_maxHeight");
$("#activity_message_<%= user_activity.id%>").show();
if($("#activity_message_<%#= user_activity.id%>").is(':hidden')){
if($("#activity_description_<%#= user_activity.id%>").height()>120){
$("#activity_description_<%#= user_activity.id%>").toggleClass("activity_description_maxHeight");
$("#activity_message_<%#= user_activity.id%>").show();
}
}
}
var div = $("#activity_description_<%= user_activity.id%>");
var div = $("#activity_description_<%#= user_activity.id%>");
var imgs = $('img',div);
var lens = imgs.length;
function nh_load_img_end(){
@ -24,8 +24,8 @@
});
}
nh_show_btn();
});
function show_more_reply(contentid, id2, id3) {
});*/
/*function show_more_reply(contentid, id2, id3) {
$(contentid).toggleClass("activity_description_maxHeight");
$(contentid).toggleClass("course_description_none");
var information = $(id2);
@ -41,7 +41,7 @@
information.attr("value", "show_more");
arrow.attr("src", "/images/jiantou.jpg")
}
}
}*/
function expand_reply(container,btnid){
var target = $(container);
var btn = $(btnid);

View File

@ -1,10 +1,10 @@
<script type="text/javascript">
var scrollHandler = function(){
var scrollHandler = function () {
if ($(window).scrollTop() == $(document).height() - $(window).height()) {
$.get(
'<%= user_activities_path(@user.id)%>',
{ page : $("#show_more_activities").val(),
type: $("#user_activities_type").val()},
{ page: $("#show_more_activities").val(),
type: $("#user_activities_type").val()},
function (data) {
}