From b624c5cc9403d58d8d45125d7f70e60cddbb9ab9 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Tue, 7 Jun 2016 11:19:09 -0400 Subject: [PATCH] FIX: Never show the "Back" button when close to the bottom of the timeline --- .../javascripts/discourse/widgets/topic-timeline.js.es6 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/widgets/topic-timeline.js.es6 b/app/assets/javascripts/discourse/widgets/topic-timeline.js.es6 index 1da99392be3..a25207609b7 100644 --- a/app/assets/javascripts/discourse/widgets/topic-timeline.js.es6 +++ b/app/assets/javascripts/discourse/widgets/topic-timeline.js.es6 @@ -143,9 +143,9 @@ createWidget('timeline-scrollarea', { this.attach('timeline-padding', { height: after }) ]; - if (position.lastRead && position.lastRead < attrs.topic.posts_count) { + if (position.lastRead) { const lastReadTop = Math.round(position.lastReadPercentage * SCROLLAREA_HEIGHT); - if (lastReadTop > (before + SCROLLER_HEIGHT)) { + if ((lastReadTop > (before + SCROLLER_HEIGHT)) && (lastReadTop < (SCROLLAREA_HEIGHT - SCROLLER_HEIGHT))) { result.push(this.attach('timeline-last-read', { top: lastReadTop, lastRead: position.lastRead })); } }