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-136133 #408

Merged
merged 4 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 3 additions & 5 deletions acrobat/scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,15 +270,13 @@ const CONFIG = {
const { ietf } = getLocale(locales);

(async function loadPage() {
const breadcrumbs = document.querySelector('.breadcrumbs');
const header = document.querySelector('header');
if (header && breadcrumbs) {
header.classList.add('with-breadcrumbs');
}

Blainegunn marked this conversation as resolved.
Show resolved Hide resolved
// Fast track the widget
const widgetBlock = document.querySelector('[class*="dc-converter-widget"]');

if (widgetBlock) {
document.body.classList.add('dc-bc');
document.querySelector('header').classList.add('has-breadcrumbs');
Blainegunn marked this conversation as resolved.
Show resolved Hide resolved
const verb = widgetBlock.children[0].children[0]?.innerText?.trim();
const blockName = widgetBlock.classList.value;
widgetBlock.removeAttribute('class');
Expand Down
24 changes: 0 additions & 24 deletions acrobat/styles/cls.css

This file was deleted.

8 changes: 3 additions & 5 deletions acrobat/styles/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@
*
*
*/
header {
min-height: 64px;
}

@media (min-width: 900px) {
Copy link

@mokimo mokimo Oct 10, 2023

Choose a reason for hiding this comment

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

We are also adding header.global-navigation { ... box-sizing: content-box; } which should help to keep the CLS away

header.with-breadcrumbs {
padding-bottom: 33px;
.dc-bc .has-breadcrumbs,
header.has-breadcrumbs {
box-sizing: content-box;
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/scripts/scripts.jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('Test scripts', () => {
document.head.innerHTML =
'<meta name="promotion" content="abc"/><meta name="dc-widget-version" content="123"/>';
document.body.innerHTML =
'<main><div class="dc-converter-widget"><div><div>pdf-to-image</div></div></div></main>';
'<header><main><div class="dc-converter-widget"><div><div>pdf-to-image</div></div></div></main></header>';
});

describe('Test prod', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/scripts/scripts.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { waitForElement, delay } from '../helpers/waitfor.js';

document.head.innerHTML = '<meta name="promotion" content="abc"/><meta name="dc-widget-version" content="123"/>';
document.body.innerHTML =
'<main><div class="promotion"/><div class="dc-converter-widget"/></main>';
'<header><main><div class="promotion"/><div class="dc-converter-widget"/></main></header>';

const { scripts } = await import('../../acrobat/scripts/scripts');

Expand Down