mirror of
https://github.com/flarum/framework.git
synced 2025-02-22 07:19:56 +08:00
Fix regression with composer scroll anchoring
This commit is contained in:
parent
22df4a3f5e
commit
214a591268
@ -96,11 +96,12 @@ export default Ember.View.extend(HasItemLists, {
|
||||
// right to the bottom of the page. If we are, we'll want to anchor
|
||||
// the body's scroll position to the bottom after we update the
|
||||
// padding.
|
||||
var anchorScroll = $(window).scrollTop() + $(window).height() > $(document).height();
|
||||
var scrollTop = $(window).scrollTop();
|
||||
var anchorScroll = scrollTop > 0 && scrollTop + $(window).height() >= $(document).height();
|
||||
|
||||
var func = animate ? 'animate' : 'css';
|
||||
var paddingBottom = this.get('visible') ? this.get('computedHeight') - Ember.$('#footer').outerHeight(true) : 0;
|
||||
$('#main')[func]({paddingBottom: paddingBottom}, 'fast');
|
||||
var paddingBottom = this.get('visible') ? this.get('computedHeight') - parseInt($('#page').css('padding-bottom')) : 0;
|
||||
$('#content')[func]({paddingBottom: paddingBottom}, 'fast');
|
||||
|
||||
if (anchorScroll) {
|
||||
if (animate) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user