Maybe finally fix this strange FF scrolling bug?
This commit is contained in:
parent
8003ff319c
commit
15c06462d2
|
@ -98,6 +98,7 @@ async function MbViewerInit () {
|
|||
|
||||
//$('section.tgme_channel_history.js-message_history').append(MakeMoreWrapperHtml(postsData[0].id, 'before'));
|
||||
$('section.tgme_channel_history.js-message_history').append(MakeMoreWrapperHtml(0, 'before'));
|
||||
MbState.lastMustScroll = 2;
|
||||
TWeb.loadMore($('.js-messages_more_wrap > a'), true);
|
||||
// TODO: scroll to the very bottom of the document somehow after showing a first message, to have a less jarring visual effect?
|
||||
}
|
||||
|
|
|
@ -189,19 +189,19 @@ var TWeb = {
|
|||
if ($before.length) {
|
||||
var bottom = $before.offset().top + $before.height() - scrollTop;
|
||||
if (bottom > -wheight * 3) {
|
||||
TWeb.loadMore($before);
|
||||
TWeb.loadMore($before, false);
|
||||
}
|
||||
}
|
||||
if ($after.length) {
|
||||
var top = $after.offset().top - scrollTop;
|
||||
if (top < wheight * 3) {
|
||||
TWeb.loadMore($after);
|
||||
TWeb.loadMore($after, false);
|
||||
}
|
||||
}
|
||||
});
|
||||
$document.on('click', '.js-messages_more', function() {
|
||||
var $el = $(this);
|
||||
TWeb.loadMore($el);
|
||||
TWeb.loadMore($el, false);
|
||||
});
|
||||
},
|
||||
initViews: function() {
|
||||
|
@ -324,12 +324,13 @@ var TWeb = {
|
|||
}
|
||||
var time3 = +(new Date);
|
||||
//console.log('inserted ' + (time3 - time2) + 'ms');
|
||||
if (!IsScrollableY($('html')[0])) {
|
||||
TWeb.loadMore($('.js-messages_more_wrap > a'), true);
|
||||
}
|
||||
if (scrollToLast) {
|
||||
if (scrollToLast || MbState.lastMustScroll > 0) {
|
||||
$('#BottomAnchor')[0].scrollIntoView();
|
||||
$('.tgme_widget_message_wrap').last().scrollIntoView();
|
||||
MbState.lastMustScroll--;
|
||||
}
|
||||
if (!IsScrollableY($('html')[0])) {
|
||||
TWeb.loadMore($('.js-messages_more_wrap > a'), true);
|
||||
}
|
||||
},
|
||||
error: function(data) {
|
||||
|
|
Loading…
Reference in New Issue