We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 7ebd360 + a33f909 commit a8561ecCopy full SHA for a8561ec
blocks/footer/footer.js
@@ -1,5 +1,6 @@
1
import { getMetadata } from '../../scripts/aem.js';
2
import { loadFragment } from '../fragment/fragment.js';
3
+import { showUpdateConsentDialog } from '../cookie-consent/cookie-consent.js';
4
5
/**
6
* loads and decorates the footer
@@ -12,6 +13,12 @@ export default async function decorate(block) {
12
13
// load footer fragment
14
const footerPath = footerMeta.footer || '/footer';
15
const fragment = await loadFragment(footerPath);
16
+ if (getMetadata('cookie-consent')) {
17
+ fragment.querySelector('a[title="Cookie preferences"]').addEventListener('click', (e) => {
18
+ showUpdateConsentDialog(getMetadata('cookie-consent'));
19
+ e.preventDefault();
20
+ });
21
+ }
22
23
// decorate footer DOM
24
const footer = document.createElement('div');
0 commit comments