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.
- Loading branch information
1 parent
5bb5f49
commit 63d6649
Showing
2 changed files
with
23 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,18 @@ | ||
export default function decorate(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'); | ||
accordions.forEach((accordion) => { | ||
accordion.children[0].addEventListener('click', () => { | ||
const content = accordion.querySelector('.content'); | ||
content.style.display = content.style.display === 'none' ? 'block' : 'none'; | ||
}); | ||
}); | ||
} |