generated from adobe/aem-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #226 from hlxsites/feature/order-form
created the order form
- Loading branch information
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.order-form .table_order button { | ||
font-size: 12px!important; | ||
padding: 0.8em 0.9em!important; | ||
transition: all 0.3s ease; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
export default function buildAutoBlocks(block) { | ||
const para = block.innerText; | ||
block.innerHTML = para; | ||
const forms = block.querySelectorAll('form'); | ||
forms.forEach((form) => { | ||
const originalUrl = form.action; | ||
const continueUrl = window.location.href; | ||
// Replace the 'continue' parameter or add it if it doesn't exist | ||
form.action = originalUrl.replace(/(\?|&)continue=([^&]*)/, `$1continue=${continueUrl}`); | ||
}); | ||
const accordions = block.querySelectorAll('.mmg-collapsible'); | ||
if (accordions.length > 0) { | ||
accordions.forEach((accordion) => { | ||
accordion.children[0].addEventListener('click', () => { | ||
const content = accordion.querySelector('.content'); | ||
content.style.display = content.style.display === 'none' ? 'block' : 'none'; | ||
}); | ||
}); | ||
} | ||
} |