mirror of
https://github.com/flarum/core.git
synced 2025-07-31 21:50:50 +02:00
Fix regression with composer scroll anchoring
This commit is contained in:
@@ -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
|
// 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
|
// the body's scroll position to the bottom after we update the
|
||||||
// padding.
|
// 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 func = animate ? 'animate' : 'css';
|
||||||
var paddingBottom = this.get('visible') ? this.get('computedHeight') - Ember.$('#footer').outerHeight(true) : 0;
|
var paddingBottom = this.get('visible') ? this.get('computedHeight') - parseInt($('#page').css('padding-bottom')) : 0;
|
||||||
$('#main')[func]({paddingBottom: paddingBottom}, 'fast');
|
$('#content')[func]({paddingBottom: paddingBottom}, 'fast');
|
||||||
|
|
||||||
if (anchorScroll) {
|
if (anchorScroll) {
|
||||||
if (animate) {
|
if (animate) {
|
||||||
|
Reference in New Issue
Block a user