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

clients(psi): pass score scale to psi #8827

Merged
merged 3 commits into from
May 3, 2019
Merged
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
8 changes: 6 additions & 2 deletions lighthouse-core/report/html/renderer/psi.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*
* @param {LH.Result | string} LHResult The stringified version of {LH.Result}
* @param {Document} document The host page's window.document
* @return {{scoreGaugeEl: Element, perfCategoryEl: Element, finalScreenshotDataUri: string|null}}
* @return {{scoreGaugeEl: Element, perfCategoryEl: Element, finalScreenshotDataUri: string|null, scoreScaleEl: Element|null}}
brendankenny marked this conversation as resolved.
Show resolved Hide resolved
*/
function prepareLabData(LHResult, document) {
const lhResult = (typeof LHResult === 'string') ?
Expand Down Expand Up @@ -64,7 +64,11 @@ function prepareLabData(LHResult, document) {
scoreGaugeWrapperEl.removeAttribute('href');

const finalScreenshotDataUri = _getFinalScreenshot(perfCategory);
return {scoreGaugeEl, perfCategoryEl, finalScreenshotDataUri};

const clonedScoreTemplate = dom.cloneTemplate('#tmpl-lh-scorescale', dom.document());
const scoreScaleEl = dom.find('.lh-scorescale', clonedScoreTemplate);

return {scoreGaugeEl, perfCategoryEl, finalScreenshotDataUri, scoreScaleEl};
}

/**
Expand Down