comparison media/js/comments.js @ 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 b8474ffe76d9
children
comparison
equal deleted inserted replaced
199:217119c87a06 200:7d3e5aca095f
17 object_pk : $('#id_object_pk').val() 17 object_pk : $('#id_object_pk').val()
18 }, 18 },
19 dataType: 'html', 19 dataType: 'html',
20 success: function (data, textStatus) { 20 success: function (data, textStatus) {
21 postText.val(''); 21 postText.val('');
22 $('#comment-list').append(data); 22 $('#comment-container').append(data);
23 var lastLi = $('#comment-list > li:last'); 23 var newDiv = $('#comment-container > div:last');
24 lastLi.hide(); 24 newDiv.hide();
25 lastLi.fadeIn(3000); 25 var num = $('.comment-list', newDiv);
26 num.html($('#comment-container > div').size() + ".");
27 newDiv.fadeIn(3000);
26 postButton.removeAttr('disabled').val('Post Comment'); 28 postButton.removeAttr('disabled').val('Post Comment');
27 var count = $('#comment-count'); 29 var count = $('#comment-count');
28 if (count.length) { 30 if (count.length) {
29 count.html(parseInt(count.html()) + 1); 31 count.html(parseInt(count.html()) + 1);
30 } 32 }