mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
@@ -10,15 +10,20 @@ define('forum/infinitescroll', function () {
|
||||
var scrollTimeout = 0;
|
||||
|
||||
scroll.init = function (el, cb) {
|
||||
const $body = $('body');
|
||||
if (typeof el === 'function') {
|
||||
callback = el;
|
||||
container = $('body');
|
||||
container = $body;
|
||||
} else {
|
||||
callback = cb;
|
||||
container = el || $('body');
|
||||
container = el || $body;
|
||||
}
|
||||
previousScrollTop = $(window).scrollTop();
|
||||
$(window).off('scroll', startScrollTimeout).on('scroll', startScrollTimeout);
|
||||
|
||||
if ($body.height() <= $(window).height()) {
|
||||
callback(1);
|
||||
}
|
||||
};
|
||||
|
||||
function startScrollTimeout() {
|
||||
|
||||
Reference in New Issue
Block a user