UX: Take header height into account when positioning the timeline
This commit is contained in:
parent
025fca607e
commit
a0c936dadb
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue