From 9e39474ef9cb196488f4ec65594f6516feb046de Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Thu, 19 May 2016 12:42:54 -0400 Subject: [PATCH] FIX: First time switching to docked was placing it in the wrong pos --- .../javascripts/discourse/components/topic-timeline.js.es6 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/components/topic-timeline.js.es6 b/app/assets/javascripts/discourse/components/topic-timeline.js.es6 index 1a5dcbbdd9e..ff4316f2808 100644 --- a/app/assets/javascripts/discourse/components/topic-timeline.js.es6 +++ b/app/assets/javascripts/discourse/components/topic-timeline.js.es6 @@ -15,13 +15,14 @@ export default MountWidget.extend(Docking, { const topicBottom = $('#topic-bottom').offset().top; const $timeline = this.$('.timeline-container'); const timelineHeight = $timeline.height(); + const parentTop = $('.posts-wrapper').offset().top; const tTop = 140; const prev = this.dockAt; const pos = tTop + info.offset() + timelineHeight; if (pos > topicBottom) { - this.dockAt = topicBottom - timelineHeight - $timeline.offsetParent().offset().top; + this.dockAt = topicBottom - timelineHeight - parentTop; } else { this.dockAt = null; }