{"version":3,"file":"../arlo-catalogue.js","names":["jQuery","document","addEventListener","catalogue","moduleType","targetElement","template","nextRunningEventFilterControlId","maxNextRunningEvents","categoryFilterDefaultValue","getElementById","dataset","id","loadNextRunningButtonText","includeLoadMoreButton","loadMoreButtonText","maxCount","window","ArloWebControls","start","platformID","showDevErrors","modules","categoryItemsOnShow","getRenderCollectionElements","$","listItems","listParent","parent","setTimeout","each","find","_index","listItem","location","text","removeClass","addClass","css","online","length"],"sources":["arlo-catalogue.js"],"sourcesContent":["(function ($) {\r\n document.addEventListener('arlojscontrolsloaded', function () {\r\n var catId = document.getElementById('category-id');\r\n const platformID = 'forthvalleycollege.arlo.co';\r\n\r\n const catalogue = {\r\n moduleType: 'CategoryCatalogue',\r\n targetElement: '#arlo-catalogue',\r\n template: '#catalogue-template',\r\n nextRunningEventFilterControlId: 2,\r\n maxNextRunningEvents: 1,\r\n categoryFilterDefaultValue: catId.dataset.id,\r\n loadNextRunningButtonText: 'Find courses',\r\n includeLoadMoreButton: true,\r\n loadMoreButtonText: 'Show more categories',\r\n maxCount: 3,\r\n };\r\n\r\n const app = new window.ArloWebControls();\r\n\r\n app.start({\r\n platformID: platformID,\r\n showDevErrors: false,\r\n modules: [catalogue],\r\n });\r\n });\r\n\r\n /* ----- Callback functions ----- */\r\n\r\n // Events \"OnShow\" callback\r\n window.categoryItemsOnShow = function (getRenderCollectionElements, $) {\r\n const listItems = getRenderCollectionElements();\r\n const listParent = $(listItems[0]).parent()[0];\r\n\r\n // Set all list items to height of tallest item plus padding\r\n function setEventTemplateListItemHeight() {\r\n // Don't run functtion on mobile devices\r\n if ($(listParent).width() < 767) {\r\n return;\r\n }\r\n\r\n $(listParent).find('.arlo-listitem').height('auto');\r\n let tallestListItemHeight = 0;\r\n\r\n $.each($(listParent).find('.arlo-listitem'), function (index, listItem) {\r\n // Get height from combining heights of list item elements (because of issue with using listitems own height)\r\n let height = 0;\r\n height += $(listItem).height();\r\n\r\n if (height > tallestListItemHeight) {\r\n tallestListItemHeight = height;\r\n }\r\n });\r\n\r\n $(listParent)\r\n .find('.arlo-listitem')\r\n .height(tallestListItemHeight + 110);\r\n }\r\n\r\n /*setTimeout(function () {\r\n setEventTemplateListItemHeight();\r\n }, 0);\r\n \r\n $(window).resize(function () {\r\n setEventTemplateListItemHeight();\r\n });*/\r\n\r\n setTimeout(function () {\r\n $.each($(listParent).find('.arlo-listitem'), function (_index, listItem) {\r\n const location = $(listItem).find('.arlo-hidden-location').text();\r\n if (location) {\r\n if (location == 'Online') {\r\n $(listItem)\r\n .find('.arlo-location i')\r\n .removeClass('fa-map-marker-alt')\r\n .addClass('fa-desktop');\r\n }\r\n\r\n $(listItem).find('.arlo-location div').text(location);\r\n $(listItem).find('.arlo-location').css('display', 'flex');\r\n }\r\n\r\n const online = $(listItem).find('.arlo-next-running-online-activity');\r\n if (online.length > 0) {\r\n $(online).find('a').text('Continuous enrolment');\r\n }\r\n });\r\n }, 500);\r\n };\r\n})(jQuery);"],"mappings":"AAyFGA,OAxFCC,SAASC,iBAAiB,wBAAwB,WAE9C,MAEMC,EAAY,CACdC,WAAY,oBACZC,cAAe,kBACfC,SAAU,sBACVC,gCAAiC,EACjCC,qBAAsB,EACtBC,2BATQR,SAASS,eAAe,eASEC,QAAQC,GAC1CC,0BAA2B,eAC3BC,uBAAuB,EACvBC,mBAAoB,uBACpBC,SAAU,IAGF,IAAIC,OAAOC,iBAEnBC,MAAM,CACNC,WAlBe,6BAmBfC,eAAe,EACfC,QAAS,CAACnB,IAElB,IAKAc,OAAOM,oBAAsB,SAAUC,EAA6BC,GAChE,MAAMC,EAAYF,IACZG,EAAaF,EAAEC,EAAU,IAAIE,SAAS,GAmC5CC,YAAW,WACPJ,EAAEK,KAAKL,EAAEE,GAAYI,KAAK,mBAAmB,SAAUC,EAAQC,GAC3D,MAAMC,EAAWT,EAAEQ,GAAUF,KAAK,yBAAyBI,OACvDD,IACgB,UAAZA,GACAT,EAAEQ,GACGF,KAAK,oBACLK,YAAY,qBACZC,SAAS,cAGlBZ,EAAEQ,GAAUF,KAAK,sBAAsBI,KAAKD,GAC5CT,EAAEQ,GAAUF,KAAK,kBAAkBO,IAAI,UAAW,SAGtD,MAAMC,EAASd,EAAEQ,GAAUF,KAAK,sCAC5BQ,EAAOC,OAAS,GAChBf,EAAEc,GAAQR,KAAK,KAAKI,KAAK,uBAEjC,GACJ,GAAG,IACP"}