diff --git a/app/assets/javascripts/discourse/components/topic-timeline.js.es6 b/app/assets/javascripts/discourse/components/topic-timeline.js.es6 index e0872e275fc..c5f17c10667 100644 --- a/app/assets/javascripts/discourse/components/topic-timeline.js.es6 +++ b/app/assets/javascripts/discourse/components/topic-timeline.js.es6 @@ -2,6 +2,8 @@ import MountWidget from 'discourse/components/mount-widget'; import Docking from 'discourse/mixins/docking'; import { observes } from 'ember-addons/ember-computed-decorators'; +const FIXED_POS = 85; + export default MountWidget.extend(Docking, { widget: 'topic-timeline-container', dockBottom: null, @@ -12,6 +14,7 @@ export default MountWidget.extend(Docking, { topicTrackingState: this.topicTrackingState, enteredIndex: this.get('enteredIndex'), dockAt: this.dockAt, + top: this.dockAt || FIXED_POS, dockBottom: this.dockBottom }; }, @@ -29,10 +32,8 @@ export default MountWidget.extend(Docking, { const timelineHeight = $timeline.height(); const footerHeight = $('.timeline-footer-controls').outerHeight(true) || 0; - const tTop = 140; - const prev = this.dockAt; - const posTop = tTop + info.offset(); + const posTop = FIXED_POS + info.offset(); const pos = posTop + timelineHeight; this.dockBottom = false; diff --git a/app/assets/javascripts/discourse/widgets/topic-timeline.js.es6 b/app/assets/javascripts/discourse/widgets/topic-timeline.js.es6 index 9fcfe691210..cbbf5568841 100644 --- a/app/assets/javascripts/discourse/widgets/topic-timeline.js.es6 +++ b/app/assets/javascripts/discourse/widgets/topic-timeline.js.es6 @@ -194,11 +194,7 @@ createWidget('topic-timeline-container', { }, buildAttributes(attrs) { - if (attrs.dockAt !== null) { - return { style: `top: ${attrs.dockAt}px` }; - }; - - return { style: 'top: 140px' }; + return { style: `top: ${attrs.top}px` }; }, html(attrs) {