UX: Move the timeline up higher on the page
This commit is contained in:
parent
2d47f144f5
commit
27b499f4dd
|
@ -2,6 +2,8 @@ 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;
|
||||||
|
|
||||||
export default MountWidget.extend(Docking, {
|
export default MountWidget.extend(Docking, {
|
||||||
widget: 'topic-timeline-container',
|
widget: 'topic-timeline-container',
|
||||||
dockBottom: null,
|
dockBottom: null,
|
||||||
|
@ -12,6 +14,7 @@ export default MountWidget.extend(Docking, {
|
||||||
topicTrackingState: this.topicTrackingState,
|
topicTrackingState: this.topicTrackingState,
|
||||||
enteredIndex: this.get('enteredIndex'),
|
enteredIndex: this.get('enteredIndex'),
|
||||||
dockAt: this.dockAt,
|
dockAt: this.dockAt,
|
||||||
|
top: this.dockAt || FIXED_POS,
|
||||||
dockBottom: this.dockBottom };
|
dockBottom: this.dockBottom };
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -29,10 +32,8 @@ export default MountWidget.extend(Docking, {
|
||||||
const timelineHeight = $timeline.height();
|
const timelineHeight = $timeline.height();
|
||||||
const footerHeight = $('.timeline-footer-controls').outerHeight(true) || 0;
|
const footerHeight = $('.timeline-footer-controls').outerHeight(true) || 0;
|
||||||
|
|
||||||
const tTop = 140;
|
|
||||||
|
|
||||||
const prev = this.dockAt;
|
const prev = this.dockAt;
|
||||||
const posTop = tTop + info.offset();
|
const posTop = FIXED_POS + info.offset();
|
||||||
const pos = posTop + timelineHeight;
|
const pos = posTop + timelineHeight;
|
||||||
|
|
||||||
this.dockBottom = false;
|
this.dockBottom = false;
|
||||||
|
|
|
@ -194,11 +194,7 @@ createWidget('topic-timeline-container', {
|
||||||
},
|
},
|
||||||
|
|
||||||
buildAttributes(attrs) {
|
buildAttributes(attrs) {
|
||||||
if (attrs.dockAt !== null) {
|
return { style: `top: ${attrs.top}px` };
|
||||||
return { style: `top: ${attrs.dockAt}px` };
|
|
||||||
};
|
|
||||||
|
|
||||||
return { style: 'top: 140px' };
|
|
||||||
},
|
},
|
||||||
|
|
||||||
html(attrs) {
|
html(attrs) {
|
||||||
|
|
Loading…
Reference in New Issue