When entering a topic, place the desired post in the middle of the page
This commit is contained in:
parent
f81680d5c7
commit
ebb001c24a
|
@ -235,7 +235,8 @@ Discourse.TopicView.reopenClass({
|
||||||
new LockOn(holderId, {offsetCalculator: function() {
|
new LockOn(holderId, {offsetCalculator: function() {
|
||||||
var $header = $('header'),
|
var $header = $('header'),
|
||||||
$title = $('#topic-title'),
|
$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);
|
return $header.outerHeight(true) + ((expectedOffset < 0) ? 0 : expectedOffset);
|
||||||
}}).lock();
|
}}).lock();
|
||||||
|
|
Loading…
Reference in New Issue