Skip to content

Commit

Permalink
THE-1370 fix plus de resultats
Browse files Browse the repository at this point in the history
  • Loading branch information
clementdelafontaine committed Oct 2, 2024
1 parent 99e68e0 commit 2e45ab3
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion components/common/results/ResultComponents.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@

<script setup>
import { useDisplay } from "vuetify";
import { onMounted, ref, watch } from "vue";
import { onMounted, onBeforeUnmount, ref, watch } from "vue";
const currentRoute = useRoute();
const router = useRouter();
const { mobile } = useDisplay();
import { replaceAndEscape } from "../services/Common";
const { setShowingNumber, getFacetsRequest } = useStrategyAPI();
Expand Down Expand Up @@ -100,6 +101,8 @@ const props = defineProps({
}
});
const scrollPosition = ref(0);
/**
* Début gestionnaire clic
*/
Expand All @@ -115,10 +118,17 @@ const handleClick = (event) => {
onMounted(() => {
document.addEventListener("click", handleClick);
// Gestion du rachargement de page au clic sur le bouton charger plus de resultats
router.afterEach(() => {
window.scrollTo(0, scrollPosition.value);
})
});
onBeforeUnmount(() => {
document.removeEventListener("click", handleClick);
router.afterEach(() => {});
});
/**
Expand Down Expand Up @@ -155,6 +165,7 @@ function updateShowingNumber(newValue) {
}
function addTenResultsToList() {
scrollPosition.value = window.scrollY;
currentShowingNumber.value += 10;
setShowingNumber(currentShowingNumber.value);
}
Expand Down

0 comments on commit 2e45ab3

Please sign in to comment.