From 2244bf2ba2e8611017de51fbeb3c449efef906f0 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 1 Mar 2019 14:16:19 +0100 Subject: iron out some kinks with scrollToItem() in combination with collapsed content and images --- view/js/main.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'view') diff --git a/view/js/main.js b/view/js/main.js index b1af29846..1322c2112 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -770,7 +770,7 @@ function updateConvItems(mode,data) { mediaPlaying = false; }); - var bimgs = ((preloadImages) ? false : $(".wall-item-body img, .wall-photo-item img").not(function() { return this.complete; })); + var bimgs = $(".wall-item-body img, .wall-photo-item img").not(function() { return this.complete; }); var bimgcount = bimgs.length; if (bimgcount) { @@ -778,16 +778,22 @@ function updateConvItems(mode,data) { bimgcount--; if (! bimgcount) { collapseHeight(); + + if(bParam_mid && mode === 'replace') + scrollToItem(); + + $(document.body).trigger("sticky_kit:recalc"); } }); } else { collapseHeight(); - } - if(bParam_mid && mode === 'replace') - scrollToItem(); + if(bParam_mid && mode === 'replace') + scrollToItem(); + + $(document.body).trigger("sticky_kit:recalc"); + } - $(document.body).trigger("sticky_kit:recalc"); } function scrollToItem() { -- cgit v1.2.3