]> git.mxchange.org Git - friendica.git/commitdiff
update comment count as new comments come in
authorFriendika <info@friendika.com>
Wed, 30 Mar 2011 01:20:52 +0000 (18:20 -0700)
committerFriendika <info@friendika.com>
Wed, 30 Mar 2011 01:20:52 +0000 (18:20 -0700)
include/main.js

index 824f2dfdfcce3843880a2e5a83ee3bc5dfd46a28..750cce74c0ed11a3fdf440071d8f0c01b2eeaaad 100644 (file)
 
                $.get(update_url,function(data) {
                        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() {
                                var ident = $(this).attr('id');
                                if($('#' + ident).length == 0) { 
-                                        $('img',this).each(function() {
-                                                $(this).attr('src',$(this).attr('dst'));
-                                        });
+                                       $('img',this).each(function() {
+                                               $(this).attr('src',$(this).attr('dst'));
+                                       });
                                        $('#' + prev).after($(this));
                                }
                                else { 
                                        $('#' + 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-dislike').replaceWith($(this).find('.wall-item-dislike'));
-                                        $('#' + ident + ' ' + '.my-comment-photo').each(function() {
-                                                $(this).attr('src',$(this).attr('dst'));
-                                        });
-
-
+                                       $('#' + ident + ' ' + '.my-comment-photo').each(function() {
+                                               $(this).attr('src',$(this).attr('dst'));
+                                       });
                                }
                                prev = ident; 
                        });