aboutsummaryrefslogtreecommitdiffstats
path: root/js/main.js
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-08-18 00:04:38 -0700
committerfriendica <info@friendica.com>2013-08-18 00:04:38 -0700
commit9fb2a87c9a55be8c0b8bffc7aa438dae5acc7390 (patch)
treee5cdccf37dfe985a0352f0cbca70cd20fcb24b9e /js/main.js
parent353ccaac05fa73b7cdca4d5cc4ed7cc789a220b8 (diff)
downloadvolse-hubzilla-9fb2a87c9a55be8c0b8bffc7aa438dae5acc7390.tar.gz
volse-hubzilla-9fb2a87c9a55be8c0b8bffc7aa438dae5acc7390.tar.bz2
volse-hubzilla-9fb2a87c9a55be8c0b8bffc7aa438dae5acc7390.zip
Another try at issue #61 and #62 - an earlier fix was partially working but the issue persisted - this extends it a bit.
Diffstat (limited to 'js/main.js')
-rw-r--r--js/main.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/js/main.js b/js/main.js
index 2d1e9ab76..9d764c74e 100644
--- a/js/main.js
+++ b/js/main.js
@@ -343,6 +343,8 @@
function updateConvItems(mode,data) {
+
+
if(mode === 'update') {
prev = 'threads-begin';
@@ -391,15 +393,31 @@ function updateConvItems(mode,data) {
});
}
if(mode === 'append') {
+
next = 'threads-end';
+
+
+
$('.thread-wrapper.toplevel_item',data).each(function() {
+
+
var ident = $(this).attr('id');
+ var commentWrap = $('#'+ident+' .collapsed-comments').attr('id');
+ var itmId = 0;
+ var isVisible = false;
+
+ if(typeof commentWrap !== 'undefined')
+ itmId = commentWrap.replace('collapsed-comments-','');
if($('#' + ident).length == 0) {
$('img',this).each(function() {
$(this).attr('src',$(this).attr('dst'));
});
+ if($('#collapsed-comments-'+itmId).is(':visible'))
+ isVisible = true;
$('#threads-end').before($(this));
+ if(isVisible)
+ showHideComments(itmId);
$(".autotime").timeago();
// $("div.wall-item-body").divgrow({ initialHeight: 400 });
@@ -408,7 +426,11 @@ function updateConvItems(mode,data) {
$('img',this).each(function() {
$(this).attr('src',$(this).attr('dst'));
});
+ if($('#collapsed-comments-'+itmId).is(':visible'))
+ isVisible = true;
$('#' + ident).replaceWith($(this));
+ if(isVisible)
+ showHideComments(itmId);
$(".autotime").timeago();
// $("div.wall-item-body").divgrow({ initialHeight: 400 });
}
@@ -425,13 +447,25 @@ function updateConvItems(mode,data) {
prev = 'threads-begin';
$('.thread-wrapper.toplevel_item',data).each(function() {
+
var ident = $(this).attr('id');
+ var commentWrap = $('#'+ident+' .collapsed-comments').attr('id');
+ var itmId = 0;
+ var isVisible = false;
+
+ if(typeof commentWrap !== 'undefined')
+ itmId = commentWrap.replace('collapsed-comments-','');
if($('#' + ident).length == 0 && profile_page == 1) {
$('img',this).each(function() {
$(this).attr('src',$(this).attr('dst'));
});
+
+ if($('#collapsed-comments-'+itmId).is(':visible'))
+ isVisible = true;
$('#' + prev).after($(this));
+ if(isVisible)
+ showHideComments(itmId);
$(".autotime").timeago();
// $("div.wall-item-body").divgrow({ initialHeight: 400 });