Skip to content

Commit a83ccfa

Browse files
Merge pull request #552 from bitdefender/DEX-21622-aem-footer-for-zh
Dex 21622 aem footer for zh
2 parents 4003c0e + cc53879 commit a83ccfa

File tree

2 files changed

+9
-32
lines changed

2 files changed

+9
-32
lines changed

_src/blocks/footer/footer.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ async function runAemFooterLogic() {
131131
// fetch footer content
132132
const aemFooterHostname = window.location.hostname.includes('.aem.')
133133
|| window.location.hostname.includes('localhost')
134-
? 'https://stage.bitdefender.com'
134+
? 'https://www.bitdefender.com'
135135
: '';
136136

137137
const websiteDomain = getDomain();
@@ -210,15 +210,6 @@ async function runAemFooterLogic() {
210210
* @param {Element} footer The footer element
211211
*/
212212
function applyFooterFactorySetup(footerMetadata, block) {
213-
// TODO: please remove this if after creating the zh-hk and zh-tw
214-
// headers in AEM
215-
const regex = /\/(zh-hk|zh-tw)\//i;
216-
const matches = window.location.href.match(regex);
217-
if (matches) {
218-
runDefaultFooterLogic(block);
219-
return;
220-
}
221-
222213
switch (footerMetadata) {
223214
case 'landingpage':
224215
runLandingpageLogic(block);

_src/blocks/header/header.js

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -544,28 +544,14 @@ async function runDefaultHeaderLogic(block) {
544544
});
545545
});
546546

547-
// TODO: please remove this if statement when the mega menu
548-
// for these domains gets created in AEM
549-
const regex = /\/(zh-hk|zh-tw)\//i;
550-
const matches = window.location.href.match(regex);
551-
if (matches) {
552-
const newScriptFile = document.createElement('script');
553-
newScriptFile.src = '/_src/scripts/vendor/mega-menu/mega-menu.js';
554-
newScriptFile.defer = true;
555-
shadowRoot.appendChild(newScriptFile);
556-
} else {
557-
// TODO: please keep the below code and move
558-
// it outside the if
559-
560-
// select all the scripts from contet div and
561-
const scripts = contentDiv.querySelectorAll('script');
562-
scripts.forEach((script) => {
563-
const newScript = document.createElement('script');
564-
newScript.src = `${Constants.PUBLIC_URL_ORIGIN}${script.getAttribute('src')}`;
565-
newScript.defer = true;
566-
contentDiv.appendChild(newScript);
567-
});
568-
}
547+
// select all the scripts from contet div and
548+
const scripts = contentDiv.querySelectorAll('script');
549+
scripts.forEach((script) => {
550+
const newScript = document.createElement('script');
551+
newScript.src = `${Constants.PUBLIC_URL_ORIGIN}${script.getAttribute('src')}`;
552+
newScript.defer = true;
553+
contentDiv.appendChild(newScript);
554+
});
569555

570556
shadowRoot.appendChild(contentDiv);
571557
const body = document.querySelector('body');

0 commit comments

Comments
 (0)