update comment count as new comments come in

This commit is contained in:
Friendika 2011-03-29 18:20:52 -07:00
parent a41b4c6e67
commit 8f547283c0

View file

@ -113,12 +113,18 @@
$.get(update_url,function(data) { $.get(update_url,function(data) {
in_progress = false; in_progress = false;
$('.ccollapse-wrapper',data).each(function() {
var ident = $(this).attr('id');
if($('#' + ident).length) {
$('#' + ident).replaceWith($(this));
}
});
$('.wall-item-outside-wrapper',data).each(function() { $('.wall-item-outside-wrapper',data).each(function() {
var ident = $(this).attr('id'); var ident = $(this).attr('id');
if($('#' + ident).length == 0) { if($('#' + ident).length == 0) {
$('img',this).each(function() { $('img',this).each(function() {
$(this).attr('src',$(this).attr('dst')); $(this).attr('src',$(this).attr('dst'));
}); });
$('#' + prev).after($(this)); $('#' + prev).after($(this));
} }
else { else {
@ -127,11 +133,9 @@
$('#' + ident + ' ' + '.wall-item-comment-wrapper').replaceWith($(this).find('.wall-item-comment-wrapper')); $('#' + ident + ' ' + '.wall-item-comment-wrapper').replaceWith($(this).find('.wall-item-comment-wrapper'));
$('#' + ident + ' ' + '.wall-item-like').replaceWith($(this).find('.wall-item-like')); $('#' + ident + ' ' + '.wall-item-like').replaceWith($(this).find('.wall-item-like'));
$('#' + ident + ' ' + '.wall-item-dislike').replaceWith($(this).find('.wall-item-dislike')); $('#' + ident + ' ' + '.wall-item-dislike').replaceWith($(this).find('.wall-item-dislike'));
$('#' + ident + ' ' + '.my-comment-photo').each(function() { $('#' + ident + ' ' + '.my-comment-photo').each(function() {
$(this).attr('src',$(this).attr('dst')); $(this).attr('src',$(this).attr('dst'));
}); });
} }
prev = ident; prev = ident;
}); });