Skip to content

Commit

Permalink
clients(psi): pass score scale element to psi (#8827)
Browse files Browse the repository at this point in the history
  • Loading branch information
exterkamp authored and brendankenny committed May 3, 2019
1 parent 171ce4a commit a91a53d
Showing 1 changed file with 6 additions and 2 deletions.
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}}
*/
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

0 comments on commit a91a53d

Please sign in to comment.