When entering a topic, place the desired post in the middle of the page

This commit is contained in:
riking 2014-02-17 15:21:35 -08:00
parent f81680d5c7
commit ebb001c24a
1 changed files with 2 additions and 1 deletions

View File

@ -235,7 +235,8 @@ Discourse.TopicView.reopenClass({
new LockOn(holderId, {offsetCalculator: function() {
var $header = $('header'),
$title = $('#topic-title'),
expectedOffset = $title.height() - $header.find('.contents').height();
windowHeight = $(window).height() - $title.height(),
expectedOffset = $title.height() - $header.find('.contents').height() + (windowHeight / 5);
return $header.outerHeight(true) + ((expectedOffset < 0) ? 0 : expectedOffset);
}}).lock();