mirror of
https://gitlab.com/octospacc/octospacc.gitlab.io
synced 2025-06-05 21:59:15 +02:00
Maybe finally fix this strange FF scrolling bug?
This commit is contained in:
@@ -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(postsData[0].id, 'before'));
|
||||||
$('section.tgme_channel_history.js-message_history').append(MakeMoreWrapperHtml(0, 'before'));
|
$('section.tgme_channel_history.js-message_history').append(MakeMoreWrapperHtml(0, 'before'));
|
||||||
|
MbState.lastMustScroll = 2;
|
||||||
TWeb.loadMore($('.js-messages_more_wrap > a'), true);
|
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?
|
// 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) {
|
if ($before.length) {
|
||||||
var bottom = $before.offset().top + $before.height() - scrollTop;
|
var bottom = $before.offset().top + $before.height() - scrollTop;
|
||||||
if (bottom > -wheight * 3) {
|
if (bottom > -wheight * 3) {
|
||||||
TWeb.loadMore($before);
|
TWeb.loadMore($before, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($after.length) {
|
if ($after.length) {
|
||||||
var top = $after.offset().top - scrollTop;
|
var top = $after.offset().top - scrollTop;
|
||||||
if (top < wheight * 3) {
|
if (top < wheight * 3) {
|
||||||
TWeb.loadMore($after);
|
TWeb.loadMore($after, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$document.on('click', '.js-messages_more', function() {
|
$document.on('click', '.js-messages_more', function() {
|
||||||
var $el = $(this);
|
var $el = $(this);
|
||||||
TWeb.loadMore($el);
|
TWeb.loadMore($el, false);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
initViews: function() {
|
initViews: function() {
|
||||||
@@ -324,12 +324,13 @@ var TWeb = {
|
|||||||
}
|
}
|
||||||
var time3 = +(new Date);
|
var time3 = +(new Date);
|
||||||
//console.log('inserted ' + (time3 - time2) + 'ms');
|
//console.log('inserted ' + (time3 - time2) + 'ms');
|
||||||
if (!IsScrollableY($('html')[0])) {
|
if (scrollToLast || MbState.lastMustScroll > 0) {
|
||||||
TWeb.loadMore($('.js-messages_more_wrap > a'), true);
|
|
||||||
}
|
|
||||||
if (scrollToLast) {
|
|
||||||
$('#BottomAnchor')[0].scrollIntoView();
|
$('#BottomAnchor')[0].scrollIntoView();
|
||||||
$('.tgme_widget_message_wrap').last().scrollIntoView();
|
$('.tgme_widget_message_wrap').last().scrollIntoView();
|
||||||
|
MbState.lastMustScroll--;
|
||||||
|
}
|
||||||
|
if (!IsScrollableY($('html')[0])) {
|
||||||
|
TWeb.loadMore($('.js-messages_more_wrap > a'), true);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function(data) {
|
error: function(data) {
|
||||||
|
Reference in New Issue
Block a user