Skip to content

Commit

Permalink
VACMS-19467 Mission Explainer id Exclusion (#2320)
Browse files Browse the repository at this point in the history
* VACMS 18724 - Adds mission explainer to Vet Centers

* margin 32px below mission explainer below medium-screen

* add exclusion for id for mission explainer

* change method

---------

Co-authored-by: Eli Selkin <[email protected]>
Co-authored-by: Chris Kim <[email protected]>
  • Loading branch information
3 people authored Oct 30, 2024
1 parent 37a3fed commit 54aaa70
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/site/layouts/vet_center.drupal.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
{% endif %}

{% if fieldMissionExplainer.fetched %}
<va-summary-box class="vads-u-margin-bottom--4 medium-screen:vads-u-margin-bottom--0">
<va-summary-box class="vads-u-margin-bottom--4 medium-screen:vads-u-margin-bottom--0" data-header-id-excluded="true">
<h2 slot="headline">{{ fieldMissionExplainer.fetched.fieldMagicheadHeading.0.value }}</h2>
{{ fieldMissionExplainer.fetched.fieldMagicheadBody.0.value }}
</va-summary-box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,17 @@ module.exports = {
const isInAccordionButton = parent.hasClass('usa-accordion-button');
const isInAlert = parent.hasClass('usa-alert-body');
const isAccordion = parent.hasClass('va-accordion-item');
const isHeaderExcluded =
parent.attr('data-header-id-excluded') === 'true';

// skip heading if it already has an id
// skip heading if it's in an accordion button or an alert
if (
!heading.attr('id') &&
!isInAccordionButton &&
!isInAlert &&
!isAccordion
!isAccordion &&
!isHeaderExcluded
) {
const headingID = createUniqueId(heading, headingOptions);
heading.attr('id', headingID);
Expand Down

0 comments on commit 54aaa70

Please sign in to comment.