mirror of
https://github.com/flarum/framework.git
synced 2024-12-04 08:13:39 +08:00
Maintain scroll position relative to bottom of hero when switching categories
This commit is contained in:
parent
8f7e563036
commit
c95b8838ac
|
@ -129,8 +129,14 @@ export default class IndexPage extends Component {
|
|||
$('body').removeClass('index-page');
|
||||
}
|
||||
|
||||
|
||||
var heroHeight = this.$('.hero').css('height', '').outerHeight();
|
||||
var scrollTop = app.cache.scrollTop;
|
||||
$(window).scrollTop(scrollTop);
|
||||
|
||||
$('.global-page').css('min-height', $(window).height() + heroHeight);
|
||||
$(window).scrollTop(scrollTop - (app.cache.heroHeight - heroHeight));
|
||||
|
||||
app.cache.heroHeight = heroHeight;
|
||||
|
||||
if (this.lastDiscussion) {
|
||||
var $discussion = this.$('.discussion-summary[data-id='+this.lastDiscussion.id()+']');
|
||||
|
|
Loading…
Reference in New Issue
Block a user