mirror of
https://gitlab.com/octospacc/octospacc.gitlab.io
synced 2025-06-05 21:59:15 +02:00
Try fixing scrolling bug...
This commit is contained in:
@ -13,19 +13,19 @@ let MbState = {};
|
|||||||
|
|
||||||
// <https://stackoverflow.com/questions/29956338/how-to-accurately-determine-if-an-element-is-scrollable/71170105#71170105>
|
// <https://stackoverflow.com/questions/29956338/how-to-accurately-determine-if-an-element-is-scrollable/71170105#71170105>
|
||||||
function CanScrollEl(el, scrollAxis) {
|
function CanScrollEl(el, scrollAxis) {
|
||||||
if (0 === el[scrollAxis]) {
|
if (0 === el[scrollAxis]) {
|
||||||
el[scrollAxis] = 1;
|
el[scrollAxis] = 1;
|
||||||
if (1 === el[scrollAxis]) {
|
if (1 === el[scrollAxis]) {
|
||||||
el[scrollAxis] = 0;
|
el[scrollAxis] = 0;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
function IsScrollableY(el) {
|
function IsScrollableY(el) {
|
||||||
return (el.scrollHeight > el.clientHeight) && CanScrollEl(el, 'scrollTop') && ('hidden' !== getComputedStyle(el).overflowY);
|
return (el.scrollHeight > el.clientHeight) && CanScrollEl(el, 'scrollTop') && ('hidden' !== getComputedStyle(el).overflowY);
|
||||||
}
|
}
|
||||||
|
|
||||||
function GetDomainFromUrl (url) {
|
function GetDomainFromUrl (url) {
|
||||||
|
@ -324,13 +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 (scrollToLast) {
|
|
||||||
//$('#BottomAnchor')[0].scrollIntoView();
|
|
||||||
$('.tgme_widget_message_wrap').last().scrollIntoView();
|
|
||||||
}
|
|
||||||
if (!IsScrollableY($('html')[0])) {
|
if (!IsScrollableY($('html')[0])) {
|
||||||
TWeb.loadMore($('.js-messages_more_wrap > a'), true);
|
TWeb.loadMore($('.js-messages_more_wrap > a'), true);
|
||||||
}
|
}
|
||||||
|
if (scrollToLast) {
|
||||||
|
$('#BottomAnchor')[0].scrollIntoView();
|
||||||
|
$('.tgme_widget_message_wrap').last().scrollIntoView();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
error: function(data) {
|
error: function(data) {
|
||||||
var timeout = $moreEl.data('timeout') || 1000;
|
var timeout = $moreEl.data('timeout') || 1000;
|
||||||
|
Reference in New Issue
Block a user