FIX: First time switching to docked was placing it in the wrong pos

This commit is contained in:
Robin Ward 2016-05-19 12:42:54 -04:00
parent fa2bffd618
commit 9e39474ef9
No known key found for this signature in database
GPG Key ID: 0E091E2B4ED1B83D
1 changed files with 2 additions and 1 deletions

View File

@ -15,13 +15,14 @@ export default MountWidget.extend(Docking, {
const topicBottom = $('#topic-bottom').offset().top;
const $timeline = this.$('.timeline-container');
const timelineHeight = $timeline.height();
const parentTop = $('.posts-wrapper').offset().top;
const tTop = 140;
const prev = this.dockAt;
const pos = tTop + info.offset() + timelineHeight;
if (pos > topicBottom) {
this.dockAt = topicBottom - timelineHeight - $timeline.offsetParent().offset().top;
this.dockAt = topicBottom - timelineHeight - parentTop;
} else {
this.dockAt = null;
}