fix page jumping when liking a collapsed/expanded post

(cherry picked from commit 54806f6ee8)
This commit is contained in:
Mario Vavti 2019-01-23 14:36:34 +00:00 committed by Mario
parent 57dde3e980
commit ddbc35181c

View File

@ -832,10 +832,10 @@ function collapseHeight() {
});
var collapsedContentHeight = Math.ceil($("#region_2").height());
contentHeightDiff = origContentHeight - collapsedContentHeight;
contentHeightDiff = liking ? 0 : origContentHeight - collapsedContentHeight;
console.log('collapseHeight() - contentHeightDiff: ' + contentHeightDiff + 'px');
if(i){
if(i && !liking){
var sval = position - cDiff + ($(".divgrow-showmore").outerHeight() * i);
console.log('collapsed above viewport count: ' + i);
$(window).scrollTop(sval);