UX: Take header height into account when positioning the timeline

This commit is contained in:
Robin Ward 2017-05-15 11:51:49 -04:00
parent 025fca607e
commit a0c936dadb
1 changed files with 3 additions and 4 deletions

View File

@ -2,7 +2,7 @@ import MountWidget from 'discourse/components/mount-widget';
import Docking from 'discourse/mixins/docking'; import Docking from 'discourse/mixins/docking';
import { observes } from 'ember-addons/ember-computed-decorators'; 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, { export default MountWidget.extend(Docking, {
widget: 'topic-timeline-container', widget: 'topic-timeline-container',
@ -27,8 +27,7 @@ export default MountWidget.extend(Docking, {
attrs.fullScreen = true; attrs.fullScreen = true;
attrs.addShowClass = this.get('addShowClass'); attrs.addShowClass = this.get('addShowClass');
} else { } else {
attrs.dockAt = this.dockAt; attrs.top = this.dockAt || headerPadding();
attrs.top = this.dockAt || FIXED_POS;
} }
return attrs; return attrs;
@ -49,7 +48,7 @@ export default MountWidget.extend(Docking, {
const footerHeight = $('.timeline-footer-controls').outerHeight(true) || 0; const footerHeight = $('.timeline-footer-controls').outerHeight(true) || 0;
const prev = this.dockAt; const prev = this.dockAt;
const posTop = FIXED_POS + info.offset(); const posTop = headerPadding() + info.offset();
const pos = posTop + timelineHeight; const pos = posTop + timelineHeight;
this.dockBottom = false; this.dockBottom = false;