diff --git a/blocks/gmo-program-details/gmo-program-details.js b/blocks/gmo-program-details/gmo-program-details.js index 3c10bd9..1e08648 100644 --- a/blocks/gmo-program-details/gmo-program-details.js +++ b/blocks/gmo-program-details/gmo-program-details.js @@ -141,7 +141,6 @@ export default async function decorate(block) { // deliverables tab const expandCollapseTooltip = 'Expand/Collapse All Deliverable Tasks'; - const expandCollapseTooltip = 'Expand/Collapse All Deliverable Tasks'; const deliverablesTab = div( { id: 'tab2', class: 'deliverables tab inactive'}, div( @@ -498,6 +497,22 @@ async function addProgramStats(block) { hideLoadingOverlay(bodyWrapper); } +function toggleGroup(group, expand) { + if (expand) { + group.querySelector('.icon-next').classList.add('inactive'); + group.querySelector('.icon-collapse').classList.remove('inactive'); + } else { + group.querySelector('.icon-next').classList.remove('inactive'); + group.querySelector('.icon-collapse').classList.add('inactive'); + } + Array.from(group.children).forEach((child) => { + if (child.classList.contains('row')) { + child.classList.toggle('inactive', !expand); + } + }); +}; +} + function toggleGroup(group, expand) { if (expand) { group.querySelector('.icon-next').classList.add('inactive'); @@ -751,6 +766,7 @@ async function buildFieldScopes(scopeTypeId, scopes, block, associationMap) { }); }); } + } function buildKPIList(program) { let kpiList = document.createElement('ul');