Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MWPW-129281 - CLS Regression #267

Merged
merged 4 commits into from
Jul 23, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions acrobat/blocks/eventwrapper/eventwrapper.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ 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;
Expand Down
5 changes: 5 additions & 0 deletions acrobat/blocks/eventwrapper/eventwrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const TRY_ANOTHER = 'try-another-file-start';

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 @@ -92,6 +93,7 @@ export default function init(element) {
break;
case UPLOAD_START:
setCurrentEvent('upload');
if (reviewBlock[0]) { reviewBlock[0].classList.add('fade'); };
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you might want to hide it immediately on upload (simultaneously or prior to shifting the content upward) then fade it back in after the upload completes? It might even be possible to do this with only CSS rules

break;
case UPLOAD_COMPLETE:
setCurrentEvent('uploadcomplete');
Expand All @@ -107,12 +109,15 @@ export default function init(element) {
break;
case CONVERSION_COM:
setCurrentEvent('complete');
if (reviewBlock[0]) { reviewBlock[0].classList.remove('fade'); };
break;
case PREVIEW_GEN:
setCurrentEvent('preview');
if (reviewBlock[0]) { reviewBlock[0].classList.remove('fade'); };
break;
case DROPZONE_DIS:
setCurrentEvent(DROPZONE_DIS);
if (reviewBlock[0]) { reviewBlock[0].classList.remove('fade'); };
break;
case DOWNLOAD_START:
setCurrentEvent('download');
Expand Down