mirror of
https://github.com/rommapp/romm.git
synced 2026-11-30 02:22:44 +01:00
rename to windowy
This commit is contained in:
@@ -30,12 +30,12 @@ function onHover(emitData: { isHovering: boolean; id: number }) {
|
||||
hoveringCollectionId.value = emitData.id;
|
||||
}
|
||||
|
||||
const { y: documentY } = useScroll(window, { throttle: 100 });
|
||||
const { y: windowY } = useScroll(window, { throttle: 100 });
|
||||
|
||||
// Watch for scroll changes and trigger the throttled function
|
||||
watch(documentY, () => {
|
||||
watch(windowY, () => {
|
||||
if (
|
||||
documentY.value + window.innerHeight >= document.body.scrollHeight - 300 &&
|
||||
windowY.value + window.innerHeight >= document.body.scrollHeight - 300 &&
|
||||
visibleCollections.value < props.collections.length
|
||||
) {
|
||||
visibleCollections.value += 72;
|
||||
|
||||
@@ -136,16 +136,15 @@ function onGameTouchEnd() {
|
||||
clearTimeout(timeout);
|
||||
}
|
||||
|
||||
const { y: documentY } = useScroll(window, { throttle: 500 });
|
||||
const { y: windowY } = useScroll(window, { throttle: 500 });
|
||||
|
||||
watch(documentY, () => {
|
||||
watch(windowY, () => {
|
||||
clearTimeout(timeout);
|
||||
|
||||
window.setTimeout(async () => {
|
||||
scrolledToTop.value = documentY.value === 0;
|
||||
scrolledToTop.value = windowY.value === 0;
|
||||
if (
|
||||
documentY.value + window.innerHeight >=
|
||||
document.body.scrollHeight - 300 &&
|
||||
windowY.value + window.innerHeight >= document.body.scrollHeight - 300 &&
|
||||
fetchTotalRoms.value > filteredRoms.value.length
|
||||
) {
|
||||
await fetchRoms();
|
||||
|
||||
@@ -116,16 +116,15 @@ function onGameTouchEnd() {
|
||||
clearTimeout(timeout);
|
||||
}
|
||||
|
||||
const { y: documentY } = useScroll(window, { throttle: 500 });
|
||||
const { y: windowY } = useScroll(window, { throttle: 500 });
|
||||
|
||||
watch(documentY, () => {
|
||||
watch(windowY, () => {
|
||||
clearTimeout(timeout);
|
||||
|
||||
window.setTimeout(async () => {
|
||||
scrolledToTop.value = documentY.value === 0;
|
||||
scrolledToTop.value = windowY.value === 0;
|
||||
if (
|
||||
documentY.value + window.innerHeight >=
|
||||
document.body.scrollHeight - 300 &&
|
||||
windowY.value + window.innerHeight >= document.body.scrollHeight - 300 &&
|
||||
fetchTotalRoms.value > filteredRoms.value.length
|
||||
) {
|
||||
await fetchRoms();
|
||||
|
||||
@@ -114,16 +114,15 @@ function fetchRoms() {
|
||||
});
|
||||
}
|
||||
|
||||
const { y: documentY } = useScroll(window, { throttle: 500 });
|
||||
const { y: windowY } = useScroll(window, { throttle: 500 });
|
||||
|
||||
watch(documentY, () => {
|
||||
watch(windowY, () => {
|
||||
clearTimeout(timeout);
|
||||
|
||||
window.setTimeout(async () => {
|
||||
scrolledToTop.value = documentY.value === 0;
|
||||
scrolledToTop.value = windowY.value === 0;
|
||||
if (
|
||||
documentY.value + window.innerHeight >=
|
||||
document.body.scrollHeight - 300 &&
|
||||
windowY.value + window.innerHeight >= document.body.scrollHeight - 300 &&
|
||||
fetchTotalRoms.value > filteredRoms.value.length
|
||||
) {
|
||||
await fetchRoms();
|
||||
|
||||
@@ -161,7 +161,7 @@ function resetMissingRoms() {
|
||||
galleryFilterStore.resetFilters();
|
||||
}
|
||||
|
||||
const { y: documentY } = useScroll(window, { throttle: 500 });
|
||||
const { y: windowY } = useScroll(window, { throttle: 500 });
|
||||
|
||||
// Watch for tab changes and update URL
|
||||
watch(tab, (newTab) => {
|
||||
@@ -185,14 +185,13 @@ watch(
|
||||
{ immediate: true },
|
||||
);
|
||||
|
||||
watch(documentY, () => {
|
||||
watch(windowY, () => {
|
||||
clearTimeout(timeout);
|
||||
|
||||
window.setTimeout(async () => {
|
||||
scrolledToTop.value = documentY.value === 0;
|
||||
scrolledToTop.value = windowY.value === 0;
|
||||
if (
|
||||
documentY.value + window.innerHeight >=
|
||||
document.body.scrollHeight - 300 &&
|
||||
windowY.value + window.innerHeight >= document.body.scrollHeight - 300 &&
|
||||
fetchTotalRoms.value > filteredRoms.value.length
|
||||
) {
|
||||
await fetchRoms();
|
||||
|
||||
Reference in New Issue
Block a user