aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-02-17 11:07:47 +0100
committerMario Vavti <mario@mariovavti.com>2016-02-17 11:07:47 +0100
commitb8c7b2f81df61e5068366cbdb0f18940ff5d4bf1 (patch)
tree961fcc8a883e079e451597a7865bce5d8720c8d1
parent89c6cda3038a0777bee6128f599f9a366f0bdcc2 (diff)
downloadvolse-hubzilla-b8c7b2f81df61e5068366cbdb0f18940ff5d4bf1.tar.gz
volse-hubzilla-b8c7b2f81df61e5068366cbdb0f18940ff5d4bf1.tar.bz2
volse-hubzilla-b8c7b2f81df61e5068366cbdb0f18940ff5d4bf1.zip
more refinement on collapsing
-rw-r--r--view/js/main.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/view/js/main.js b/view/js/main.js
index ca2f3bbcb..6bc7d9e91 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -648,9 +648,12 @@ function collapseHeight() {
if(! $(this).hasClass('divmore')) {
//var trigger = $(window).scrollTop() < $(this).offset().top ? true : false;
+ //console.log($(this).offset().top + divmore_height - $(window).scrollTop() + cDiff - ($(".divgrow-showmore").outerHeight() * i));
// check if we will collapse some content above the visible content and compensate the diff later
- if(($(this).offset().top + orgHeight - $(window).scrollTop()) < 50) {
+ if($(this).offset().top + divmore_height - $(window).scrollTop() + cDiff - ($(".divgrow-showmore").outerHeight() * i) < 65) {
+ //$(this).css('color', 'red');
+ //console.log($(this).offset().top + divmore_height + ' / ' + $(window).scrollTop());
diff = orgHeight - divmore_height;
cDiff = cDiff + diff;
i++;
@@ -753,7 +756,8 @@ function liveUpdate() {
$("#page-spinner").spin(false);
$("#profile-jot-text-loading").spin(false);
- //$(window).scrollTop($(window).scrollTop() + $("#region_2").height() - orgHeight + contentHeightDiff);
+ // adjust scroll position if new content was added above viewport
+ $(window).scrollTop($(window).scrollTop() + $("#region_2").height() - orgHeight + contentHeightDiff);
in_progress = false;