Skip to content

Commit

Permalink
Merge pull request #734 from adobecom/MWPW-155520
Browse files Browse the repository at this point in the history
 MWPW-155520
  • Loading branch information
Blainegunn authored Jul 30, 2024
2 parents 059e808 + 81a0595 commit 620e005
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion acrobat/blocks/mobile-widget/mobile-widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export default async function init(element) {
element.closest('main > div').dataset.section = 'widget';
const { createTag } = await import(`${miloLibs}/utils/utils.js`);
const content = Array.from(element.querySelectorAll(':scope > div'));
const VERB = element.classList.value.replace('mobile-widget', '').trim();
const VERB = element.dataset.verb;
content.forEach((con) => con.classList.add('hide'));
createMobileWidget(createTag, element, content, VERB);
// Listen for the IMS:Ready event and call redDir if user is signed in
Expand Down
8 changes: 6 additions & 2 deletions acrobat/scripts/alloy/mobile-widget-shown.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ export default function init(verb) {
},
},
};
setTimeout(() => {
window?._satellite?.track('event', event);
// Alloy Ready...
const AlloyReady = setInterval(() => {
if (window?._satellite?.track) {
clearInterval(AlloyReady);
window?._satellite?.track('event', event);
}
}, 1000);
}
2 changes: 2 additions & 0 deletions acrobat/scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,8 @@ const { ietf } = getLocale(locales);
const hasMobileAppBlock = window.browser.isMobile && document.querySelector('meta[name="mobile-widget"]')?.content === 'true';

if (hasMobileAppBlock && mobileAppBlock) {
mobileAppBlock.dataset.verb = mobileAppBlock.classList.value.replace('mobile-widget', '').trim();
document.body.classList.add('dc-bc');
mobileAppBlock.removeAttribute('class');
mobileAppBlock.id = 'mobile-widget';
const { default: dcConverterq } = await import('../blocks/mobile-widget/mobile-widget.js');
Expand Down

0 comments on commit 620e005

Please sign in to comment.