Permalink
Browse files

changed order of comments to asc and moved comment form to bottom of …

…comments list
  • Loading branch information...
1 parent 1788875 commit 0d63a070d0d17ce4f185e0dadf93485320e3a080 @rlbrackett3 committed Feb 14, 2011
@@ -9,7 +9,7 @@ class CommentsController < ApplicationController
def index
@user = User.find_by_slug(params[:user_id])
@post = @user.posts.find(params[:post_id])
- @comments = @post.comments.all.desc(:created_at)
+ @comments = @post.comments.all.asc(:created_at)
respond_with(@post, @comment, :layout => !request.xhr?)
end
@@ -17,7 +17,7 @@ var el = $('<%= escape_javascript("#comment_form_#{@post.id}")%>');
var commentImage = $('#<%= escape_javascript("feeditem_comments_img_#{@post.id}") %>');
// render partial to display comment
- $(commentsList).prepend("<%= escape_javascript(render 'comments/show') %>");
+ $(commentsList).append("<%= escape_javascript(render 'comments/show') %>");
// update comment count
$(commentCount).text("<%= escape_javascript(@post.comments_count.to_s) %>");
@@ -2,15 +2,17 @@
var feeditemComments = $('<%= escape_javascript("#feeditem_comments_#{@post.id}")%>');
var commentsContainer = $('<%= escape_javascript("#comments_container_#{@post.id}")%>');
var showComments = $('<%= escape_javascript("#feeditem_comments_link_#{@post.id}")%>');
-var commentForm = $('<%= escape_javascript("#comment_form_#{@post.id}")%>');
+var commentForm = $('<%= escape_javascript("#new_comment_form_#{@post.id}")%>');
$(commentForm).find('p.errors').empty();
// store the display value of the feeditem comments div
var displayValue = $(feeditemComments).css('display');
if (displayValue == 'none') {
+ $(commentForm).hide();
$(feeditemComments).slideDown('slow', function() {
$(commentsContainer).slideDown('slow').replaceWith("<%= escape_javascript(render :partial => 'comments/index') %>");
+ $(commentForm).fadeIn('slow').slideDown('slow');
});
}
else {
@@ -39,6 +39,7 @@
<div id="likers_container_<%= feed_item.id %>"></div>
</li>
<li class="feed_entry_comments" id="feeditem_comments_<%= feed_item.id %>">
+ <div id="comments_container_<%= feed_item.id %>"></div>
<div class="comment_form" id="new_comment_form_<%= feed_item.id %>">
<%= form_for [current_user, feed_item, Comment.new],
:remote => true,
@@ -56,7 +57,6 @@
<p class="errors"></p><!-- format this -->
<% end %>
</div>
- <div id="comments_container_<%= feed_item.id %>"></div>
</li>
<div class="border" id="border_<%= feed_item.id %>"></div>
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
Binary file not shown.
@@ -93,7 +93,7 @@ img#landing_logo {
position: relative;
float: right;
text-align: right;
- margin: 0px 32px 0px 0px;
+ margin: 0px 30px 0px 0px;
}
#show_rand_ffflourish {
Oops, something went wrong.

0 comments on commit 0d63a07

Please sign in to comment.