Mercurial > public > sg101
changeset 200:7d3e5aca095f
Fixing #73: comments no longer getting adding to web page on submit.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 11 Apr 2010 19:41:13 +0000 |
parents | 217119c87a06 |
children | bc958bc3c6eb |
files | gpp/templates/comments/comment_list.html media/js/comments.js |
diffstat | 2 files changed, 8 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/gpp/templates/comments/comment_list.html Sun Apr 11 18:56:30 2010 +0000 +++ b/gpp/templates/comments/comment_list.html Sun Apr 11 19:41:13 2010 +0000 @@ -1,3 +1,5 @@ +<div id="comment-container"> {% for comment in comments %} {% include 'comments/comment.html' %} {% endfor %} +</div>
--- a/media/js/comments.js Sun Apr 11 18:56:30 2010 +0000 +++ b/media/js/comments.js Sun Apr 11 19:41:13 2010 +0000 @@ -19,10 +19,12 @@ dataType: 'html', success: function (data, textStatus) { postText.val(''); - $('#comment-list').append(data); - var lastLi = $('#comment-list > li:last'); - lastLi.hide(); - lastLi.fadeIn(3000); + $('#comment-container').append(data); + var newDiv = $('#comment-container > div:last'); + newDiv.hide(); + var num = $('.comment-list', newDiv); + num.html($('#comment-container > div').size() + "."); + newDiv.fadeIn(3000); postButton.removeAttr('disabled').val('Post Comment'); var count = $('#comment-count'); if (count.length) {