Pass lighthouse image size test
This commit is contained in:
parent
66da654192
commit
4e8da9e7f4
2 changed files with 3 additions and 1 deletions
|
|
@ -5,7 +5,7 @@ import { html } from '../../types/html';
|
||||||
|
|
||||||
export const generate = (): html => `
|
export const generate = (): html => `
|
||||||
<section id="image-viewer">
|
<section id="image-viewer">
|
||||||
<img image-viewer-ignore />
|
<img height="0" width="0" image-viewer-ignore />
|
||||||
<div tabindex="0" id="cancel">${cancel}</div>
|
<div tabindex="0" id="cancel">${cancel}</div>
|
||||||
</section>
|
</section>
|
||||||
`;
|
`;
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,8 @@ export class PageImageViewer extends PageElement {
|
||||||
private showImage(source: HTMLImageElement) {
|
private showImage(source: HTMLImageElement) {
|
||||||
const image = this.query('img') as HTMLImageElement;
|
const image = this.query('img') as HTMLImageElement;
|
||||||
image.src = source.src;
|
image.src = source.src;
|
||||||
|
image.height = source.height;
|
||||||
|
image.width = source.width;
|
||||||
this.htmlRoot.style.visibility = 'visible';
|
this.htmlRoot.style.visibility = 'visible';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue