diff options
author | Thomas Willingham <founder@kakste.com> | 2013-08-24 17:05:18 +0100 |
---|---|---|
committer | Thomas Willingham <founder@kakste.com> | 2013-08-24 17:05:18 +0100 |
commit | c803fb90df3bbbd8bb88df09a271b5a9214e8c1d (patch) | |
tree | 0ad021580411798fc0ab025f1b1c302fe8afd3f6 /js | |
parent | 6999fb586ba90e9f1c79e9f09f4035f63fb925fd (diff) | |
parent | b0dd38b30949f907265eda757bfa14aa1f38b38f (diff) | |
download | volse-hubzilla-c803fb90df3bbbd8bb88df09a271b5a9214e8c1d.tar.gz volse-hubzilla-c803fb90df3bbbd8bb88df09a271b5a9214e8c1d.tar.bz2 volse-hubzilla-c803fb90df3bbbd8bb88df09a271b5a9214e8c1d.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'js')
-rw-r--r-- | js/main.js | 34 |
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 }); |