diff --git a/blocks/gmo-program-list/gmo-program-list.js b/blocks/gmo-program-list/gmo-program-list.js index d1b94f1..71806d5 100644 --- a/blocks/gmo-program-list/gmo-program-list.js +++ b/blocks/gmo-program-list/gmo-program-list.js @@ -33,11 +33,13 @@ const headerConfig = [ } ] +const DEFAULT_ITEMS_PER_PAGE = 8; //Global variables used by helper functions let currentPageInfo = {}; let cursorArray = []; let currentPage = 1; -let currentNumberPerPage = 4; +let currentNumberPerPage = DEFAULT_ITEMS_PER_PAGE; + let currentGraphqlFilter = {}; //Get Campaign Count for pagination let campaignCount = await graphqlCampaignCount(); @@ -62,7 +64,7 @@ document.addEventListener('gmoCampaignListBlock', async function() { currentPageInfo = {}; cursorArray = []; currentPage = 1; - currentNumberPerPage = 4; + currentNumberPerPage = DEFAULT_ITEMS_PER_PAGE; decorate( block, currentNumberPerPage, '', false, false, currentGraphqlFilter); @@ -120,16 +122,6 @@ export default async function decorate(block, numPerPage = currentNumberPerPage, footerNext.classList.remove('active'); } decorateIcons(block); - - //Debug Global Variables - //debug_console(); -} - -function debug_console(){ - console.log('currentPageInfo',currentPageInfo); - console.log('cursorArray',cursorArray); - console.log('currentPage',currentPage); - console.log('campaignCount',campaignCount); } @@ -193,7 +185,7 @@ async function buildCampaignList(campaigns, numPerPage) { Program Name