From e85904b98f950cb9bfcd3e4a17c81ff66a35549c Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Wed, 21 Dec 2016 14:24:15 -0500 Subject: [PATCH] FIX: Clamp last read position to height of the widget --- .../javascripts/discourse/widgets/topic-timeline.js.es6 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/widgets/topic-timeline.js.es6 b/app/assets/javascripts/discourse/widgets/topic-timeline.js.es6 index 3f3e562ba0f..323094a1d36 100644 --- a/app/assets/javascripts/discourse/widgets/topic-timeline.js.es6 +++ b/app/assets/javascripts/discourse/widgets/topic-timeline.js.es6 @@ -25,7 +25,9 @@ createWidget('timeline-last-read', { tagName: 'div.timeline-last-read', buildAttributes(attrs) { - return { style: `height: 40px; top: ${attrs.top}px` }; + const bottom = SCROLLAREA_HEIGHT - 10; + const top = attrs.top > bottom ? bottom : attrs.top; + return { style: `height: 20px; top: ${top}px` }; }, html(attrs) {