This commit is contained in:
parent
da05b9736e
commit
a4c77467a7
37
js/main.js
37
js/main.js
@ -343,34 +343,26 @@
|
|||||||
|
|
||||||
function updateConvItems(mode,data) {
|
function updateConvItems(mode,data) {
|
||||||
|
|
||||||
var expanded_comments = false;
|
|
||||||
|
|
||||||
if(mode === 'update') {
|
if(mode === 'update') {
|
||||||
prev = 'threads-begin';
|
prev = 'threads-begin';
|
||||||
|
|
||||||
|
|
||||||
$('.thread-wrapper.toplevel_item',data).each(function() {
|
$('.thread-wrapper.toplevel_item',data).each(function() {
|
||||||
|
|
||||||
var ident = $(this).attr('id');
|
var ident = $(this).attr('id');
|
||||||
|
var commentWrap = $('#'+ident+' .collapsed-comments').attr('id');
|
||||||
|
var itmId = commentWrap.replace('collapsed-comments-','');
|
||||||
|
var isVisible = false;
|
||||||
|
|
||||||
if($('#' + ident).length == 0 && profile_page == 1) {
|
if($('#' + ident).length == 0 && profile_page == 1) {
|
||||||
$('img',this).each(function() {
|
$('img',this).each(function() {
|
||||||
$(this).attr('src',$(this).attr('dst'));
|
$(this).attr('src',$(this).attr('dst'));
|
||||||
});
|
});
|
||||||
|
if($('#collapsed-comments-'+itmId).is(':visible'))
|
||||||
// FIXME this doesn't work at all to prevent open comments from
|
isVisible = true;
|
||||||
// collapsing on update - but I'm leaving this experimental code here until
|
|
||||||
// I have time to dig into it again. Ideally we want to find
|
|
||||||
// the expanded comments div on the page and then expand the one we received
|
|
||||||
// over the wire (in the data variable) before placing the thread on the page,
|
|
||||||
// as then it won't blink.
|
|
||||||
|
|
||||||
expanded_comments = false;
|
|
||||||
$('.collapsed-comments',this).each(function() {
|
|
||||||
if($('.thread-wrapper',this).is(':visible'))
|
|
||||||
expanded_comments = this;
|
|
||||||
});
|
|
||||||
$('#' + prev).after($(this));
|
$('#' + prev).after($(this));
|
||||||
if(expanded_comments)
|
if(isVisible)
|
||||||
$(expanded_comments).show();
|
showHideComments(itmId);
|
||||||
$(".autotime").timeago();
|
$(".autotime").timeago();
|
||||||
// divgrow doesn't prevent itself from attaching a second (or 500th)
|
// divgrow doesn't prevent itself from attaching a second (or 500th)
|
||||||
// "show more" div to a content region - it also has a few other
|
// "show more" div to a content region - it also has a few other
|
||||||
@ -383,14 +375,11 @@ function updateConvItems(mode,data) {
|
|||||||
$(this).attr('src',$(this).attr('dst'));
|
$(this).attr('src',$(this).attr('dst'));
|
||||||
});
|
});
|
||||||
// more FIXME related to expanded comments
|
// more FIXME related to expanded comments
|
||||||
expanded_comments = false;
|
if($('#collapsed-comments-'+itmId).is(':visible'))
|
||||||
$('.collapsed-comments',this).each(function() {
|
isVisible = true;
|
||||||
if($('.thread-wrapper',this).is(':visible'))
|
|
||||||
expanded_comments = $(this);
|
|
||||||
});
|
|
||||||
$('#' + ident).replaceWith($(this));
|
$('#' + ident).replaceWith($(this));
|
||||||
if(expanded_comments)
|
if(isVisible)
|
||||||
$(expanded_comments).show();
|
showHideComments(itmId);
|
||||||
$(".autotime").timeago();
|
$(".autotime").timeago();
|
||||||
// $("div.wall-item-body").divgrow({ initialHeight: 400 });
|
// $("div.wall-item-body").divgrow({ initialHeight: 400 });
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user