From 4e1f8ec72b791006fca7c6c3347c8347d27e4dc6 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 24 Apr 2017 13:21:50 -0400 Subject: [PATCH] FIX: Without suggested topics jumping to a post had the wrong offset --- app/assets/javascripts/discourse/lib/offset-calculator.js.es6 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/lib/offset-calculator.js.es6 b/app/assets/javascripts/discourse/lib/offset-calculator.js.es6 index 92dd68dea55..3c2fc1fc71e 100644 --- a/app/assets/javascripts/discourse/lib/offset-calculator.js.es6 +++ b/app/assets/javascripts/discourse/lib/offset-calculator.js.es6 @@ -33,12 +33,11 @@ export default function offsetCalculator(y) { } - if (inter > ideal) { const bottom = $('#topic-bottom').offset().top; const switchPos = bottom - rawWinHeight; if (scrollTop > switchPos) { - const p = Math.max(Math.min((scrollTop + inter - switchPos) / rawWinHeight, 1.0), 0.0); + const p = Math.max(Math.min((scrollTop + inter - switchPos) / bottom, 1.0), 0.0); return ((1 - p) * ideal) + (p * inter); } else { return ideal;