diff options
author | Mario Vavti <mario@mariovavti.com> | 2019-01-23 14:36:34 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2019-01-24 13:39:49 +0100 |
commit | ddbc35181c2a2814466996dbc2ed6ef35261f2c8 (patch) | |
tree | 882b97f3c0d0054cf9ce74c1b9240f863737b40b | |
parent | 57dde3e980fcdb6937da4862c0bcc9914f2df24b (diff) | |
download | volse-hubzilla-ddbc35181c2a2814466996dbc2ed6ef35261f2c8.tar.gz volse-hubzilla-ddbc35181c2a2814466996dbc2ed6ef35261f2c8.tar.bz2 volse-hubzilla-ddbc35181c2a2814466996dbc2ed6ef35261f2c8.zip |
fix page jumping when liking a collapsed/expanded post
(cherry picked from commit 54806f6ee882d1d29a800f31eb42508221e59dc3)
-rw-r--r-- | view/js/main.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/view/js/main.js b/view/js/main.js index a69bcfa64..7a047cd42 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -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); |