Skip to content

Commit

Permalink
Update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
herzog31 committed Mar 1, 2024
1 parent cc71160 commit 7edef8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions blocks/enrichment/enrichment.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ export default async function decorate(block) {
.forEach((fragment) => {
const sections = fragment.querySelectorAll(':scope .section');

// If only single section, replace enrichment block with content of section
// If only single section, replace block with content of section
if (sections.length === 1) {
block.closest('.section').classList.add(...sections[0].classList);
const wrapper = block.closest('.enrichment-wrapper');
Array.from(sections[0].children)
.forEach((child) => wrapper.parentNode.insertBefore(child, wrapper));
} else if (sections.length > 1) {
// If multiple section, append them to current section
// If multiple sections, insert them after section of block
const blockSection = block.closest('.section');
Array.from(sections)
.reverse()
Expand Down

0 comments on commit 7edef8c

Please sign in to comment.