1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 07:13:58 -05:00

small code cleanups

This commit is contained in:
RaidMax
2019-07-19 14:54:39 -05:00
parent 4a013a98f8
commit 486973a2bc
8 changed files with 44 additions and 45 deletions

View File

@ -41,6 +41,20 @@ function loadMoreItems() {
loaderOffset += loadCount;
}
function ScrollHandler(e) {
//throttle event:
hasScrollBar = true;
clearTimeout(_throttleTimer);
_throttleTimer = setTimeout(function () {
//do work
if ($window.scrollTop() + $window.height() > $document.height() - 100) {
loadMoreItems();
}
}, _throttleDelay);
}
function setupListeners() {
if ($(loaderResponseId).length === 1) {
/*
@ -73,21 +87,7 @@ function setupListeners() {
if (!isLoaderLoading) {
loadMoreItems();
}
})
});
});
function ScrollHandler(e) {
//throttle event:
hasScrollBar = true;
clearTimeout(_throttleTimer);
_throttleTimer = setTimeout(function () {
//do work
if ($window.scrollTop() + $window.height() > $document.height() - 100) {
loadMoreItems();
}
}, _throttleDelay);
}
}
}