mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-11-10 08:57:25 +01:00
fix: move scroll event behind condition
This commit is contained in:
parent
0dee5073c6
commit
43ebb01b63
@ -148,24 +148,23 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!usePaging) {
|
||||||
|
let scrollMultiplier = 1
|
||||||
window.addEventListener('scroll', () => {
|
window.addEventListener('scroll', () => {
|
||||||
let {
|
let {
|
||||||
scrollTop,
|
scrollTop,
|
||||||
scrollHeight,
|
scrollHeight,
|
||||||
clientHeight
|
clientHeight
|
||||||
} = document.documentElement;
|
} = document.documentElement;
|
||||||
if (scrollTop + clientHeight >= scrollHeight && !usePaging && $jobsStore.data != null && $jobsStore.data.jobs.hasNextPage) {
|
|
||||||
fetchMore()
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
let scrollMultiplier = 1
|
if (scrollTop + clientHeight >= scrollHeight && $jobsStore.data != null && $jobsStore.data.jobs.hasNextPage) {
|
||||||
function fetchMore() {
|
|
||||||
let pendingPaging = { ...paging }
|
let pendingPaging = { ...paging }
|
||||||
scrollMultiplier += 1
|
scrollMultiplier += 1
|
||||||
pendingPaging.itemsPerPage = itemsPerPage * scrollMultiplier
|
pendingPaging.itemsPerPage = itemsPerPage * scrollMultiplier
|
||||||
paging = pendingPaging
|
paging = pendingPaging
|
||||||
}
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
let plotWidth = null;
|
let plotWidth = null;
|
||||||
let tableWidth = null;
|
let tableWidth = null;
|
||||||
|
Loading…
Reference in New Issue
Block a user