diff --git a/blocks/adp-add-to-collection-modal/adp-add-to-collection-modal.js b/blocks/adp-add-to-collection-modal/adp-add-to-collection-modal.js index c1e51e40..b1a33029 100644 --- a/blocks/adp-add-to-collection-modal/adp-add-to-collection-modal.js +++ b/blocks/adp-add-to-collection-modal/adp-add-to-collection-modal.js @@ -43,15 +43,16 @@ async function createDropdown(addToExistingRadioDropboxContainer) { dropdownSelect.classList.add('add-to-existing-dropdown'); // Add the new class // Function to load more data when reaching the end of the dropdown - //const loadMoreData = async (cursor) => { const loadMoreData = async (page) => { - const collectionData = await searchListCollection(100, page); + //Call to get the nbHits for the total number of Collections + let collectionMax = await searchListCollection(0,0); + const collectionData = await searchListCollection(collectionMax.nbHits,page); return collectionData; }; - let page = 0; - // Event listener to detect scroll and load more data when at the bottom + /* The scroll event is commented out, since the