hiding load more button when hydrating wit all publications

This commit is contained in:
Antoine M 2023-11-29 10:24:28 +01:00
parent 867a565e5a
commit c1fc8156bc

View File

@ -107,12 +107,19 @@ async function filterPublications(publicationType, e) {
const sectionWebinaires = document.querySelector('.videos-webinaires-archives'); const sectionWebinaires = document.querySelector('.videos-webinaires-archives');
const sectionHighlight = document.querySelector('#highlighted-document'); const sectionHighlight = document.querySelector('#highlighted-document');
let loadMoreBrochuresButton = sectionBrochures.querySelector('.cta--load-more');
let loadMoreFichesInfosButton = sectionFichesInfos.querySelector('.cta--load-more');
sectionFichesInfos.removeAttribute('hidden'); sectionFichesInfos.removeAttribute('hidden');
sectionWebinaires.removeAttribute('hidden'); sectionWebinaires.removeAttribute('hidden');
sectionBrochures.removeAttribute('hidden'); sectionBrochures.removeAttribute('hidden');
sectionHighlight.removeAttribute('hidden'); sectionHighlight.removeAttribute('hidden');
switch (publicationType) { switch (publicationType) {
case 'all': case 'all':
loadMoreBrochuresButton.setAttribute('hidden', true);
loadMoreFichesInfosButton.setAttribute('hidden', true);
sectionBrochures.setAttribute('isLoading', true); sectionBrochures.setAttribute('isLoading', true);
sectionFichesInfos.setAttribute('isLoading', true); sectionFichesInfos.setAttribute('isLoading', true);
sectionHighlight.setAttribute('isLoading', true); sectionHighlight.setAttribute('isLoading', true);
@ -127,6 +134,8 @@ async function filterPublications(publicationType, e) {
sectionWebinaires.setAttribute('hidden', true); sectionWebinaires.setAttribute('hidden', true);
sectionHighlight.setAttribute('hidden', true); sectionHighlight.setAttribute('hidden', true);
loadMoreBrochuresButton.setAttribute('hidden', true);
sectionBrochures.setAttribute('isLoading', true); sectionBrochures.setAttribute('isLoading', true);
await hydrateBrochureArchiveGrid(); await hydrateBrochureArchiveGrid();
sectionBrochures.removeAttribute('isLoading'); sectionBrochures.removeAttribute('isLoading');
@ -137,6 +146,8 @@ async function filterPublications(publicationType, e) {
sectionWebinaires.setAttribute('hidden', true); sectionWebinaires.setAttribute('hidden', true);
sectionHighlight.setAttribute('hidden', true); sectionHighlight.setAttribute('hidden', true);
loadMoreFichesInfosButton.setAttribute('hidden', true);
sectionFichesInfos.setAttribute('isLoading', true); sectionFichesInfos.setAttribute('isLoading', true);
await hydrateFicheInfoArchiveGrid(); await hydrateFicheInfoArchiveGrid();
sectionFichesInfos.removeAttribute('isLoading'); sectionFichesInfos.removeAttribute('isLoading');