Skip to content

Commit

Permalink
Merge pull request #267 from adobecom/MWPW-129281_v2
Browse files Browse the repository at this point in the history
MWPW-129281 - CLS Regression
  • Loading branch information
Blainegunn authored Jul 23, 2023
2 parents 7a34bed + 543f239 commit af6c7f2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
17 changes: 17 additions & 0 deletions acrobat/blocks/eventwrapper/eventwrapper.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,25 @@ body:not([data-current-event]) [data-event-name=onload] {

[data-current-event=complete] .fake-dc-wrapper,
[data-current-event=complete] #CID,
[data-current-event=start] #CID,
[data-current-event=uploadcomplete] .fake-dc-wrapper,
[data-current-event=uploadcomplete] #CID {
top: 30px;
position: relative;
}

.review.fade-in {
animation-duration: 3s;
animation-name: fade-in;
}


@keyframes fade-in {
0% {
opacity: 0;
}

100% {
opacity: 1;
}
}
8 changes: 6 additions & 2 deletions acrobat/blocks/eventwrapper/eventwrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ const DROPZONE_DIS = 'dropzone-displayed';
const PREVIEW_DIS = 'preview-displayed';
const TRY_ANOTHER = 'try-another-file-start';
// const UPSELL_DIS = 'upsell-displayed';
const FADE = 'review fade-in';

export default function init(element) {
const wrapper = element;
const reviewBlock = document.querySelectorAll('.review');
const setCurrentEvent = (event) => {
if (document.querySelectorAll(`[data-event-name="${event}"]`).length > 0) {
document.body.dataset.currentEvent = event;
Expand Down Expand Up @@ -49,7 +51,6 @@ export default function init(element) {
}else{
browserExtAlloy('modalExist', browserName);
}

});
} else {
window.dispatchEvent(event);
Expand All @@ -62,7 +63,6 @@ export default function init(element) {
let browserName = parser.getBrowserName();
let extID;
if (e === PROCESS_START) converterAnalytics();

if (e === CONVERSION_COM && parser.parsedResult.platform.type === 'desktop'
|| e === PREVIEW_DIS && parser.parsedResult.platform.type === 'desktop') {
// Browser Extension
Expand Down Expand Up @@ -97,6 +97,7 @@ export default function init(element) {
break;
case UPLOAD_START:
setCurrentEvent('upload');
if (reviewBlock[0]) { reviewBlock[0].classList.add('hide'); };
break;
case UPLOAD_COMPLETE:
setCurrentEvent('uploadcomplete');
Expand All @@ -112,12 +113,15 @@ export default function init(element) {
break;
case CONVERSION_COM:
setCurrentEvent('complete');
if (reviewBlock[0]) { reviewBlock[0].classList = FADE; };
break;
case PREVIEW_GEN:
setCurrentEvent('preview');
if (reviewBlock[0]) { reviewBlock[0].classList = FADE; };
break;
case DROPZONE_DIS:
setCurrentEvent(DROPZONE_DIS);
if (reviewBlock[0]) { reviewBlock[0].classList = FADE; };
break;
case DOWNLOAD_START:
setCurrentEvent('download');
Expand Down

0 comments on commit af6c7f2

Please sign in to comment.