1
0
mirror of https://github.com/flarum/core.git synced 2025-07-12 04:16:24 +02:00

Fix discussion list scroll position not being maintained when hero is not visible

This commit is contained in:
Toby Zerner
2018-12-03 08:50:54 +10:30
parent 15e1a154e5
commit 40dc6ac604

View File

@ -102,7 +102,7 @@ export default class IndexPage extends Page {
// previous hero. Maintain the same scroll position relative to the bottom
// of the hero so that the sidebar doesn't jump around.
const oldHeroHeight = app.cache.heroHeight;
const heroHeight = app.cache.heroHeight = this.$('.Hero').outerHeight();
const heroHeight = app.cache.heroHeight = this.$('.Hero').outerHeight() || 0;
const scrollTop = app.cache.scrollTop;
$('#app').css('min-height', $(window).height() + heroHeight);