From a0c936dadb9f903a5ba5ddd813f7a6cc93043ed3 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 15 May 2017 11:51:49 -0400 Subject: [PATCH] UX: Take header height into account when positioning the timeline --- .../javascripts/discourse/components/topic-timeline.js.es6 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/discourse/components/topic-timeline.js.es6 b/app/assets/javascripts/discourse/components/topic-timeline.js.es6 index e2b493e45e2..a5abbb6c245 100644 --- a/app/assets/javascripts/discourse/components/topic-timeline.js.es6 +++ b/app/assets/javascripts/discourse/components/topic-timeline.js.es6 @@ -2,7 +2,7 @@ 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; +const headerPadding = () => parseInt($('#main-outlet').css('padding-top')) + 3; export default MountWidget.extend(Docking, { widget: 'topic-timeline-container', @@ -27,8 +27,7 @@ export default MountWidget.extend(Docking, { attrs.fullScreen = true; attrs.addShowClass = this.get('addShowClass'); } else { - attrs.dockAt = this.dockAt; - attrs.top = this.dockAt || FIXED_POS; + attrs.top = this.dockAt || headerPadding(); } return attrs; @@ -49,7 +48,7 @@ export default MountWidget.extend(Docking, { const footerHeight = $('.timeline-footer-controls').outerHeight(true) || 0; const prev = this.dockAt; - const posTop = FIXED_POS + info.offset(); + const posTop = headerPadding() + info.offset(); const pos = posTop + timelineHeight; this.dockBottom = false;