mirror of
https://github.com/discourse/discourse.git
synced 2026-08-13 14:35:08 -05:00
When entering a topic, place the desired post in the middle of the page
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user