Skip to content

Commit

Permalink
feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish committed May 17, 2017
1 parent e9fbdba commit 3ab552e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions lighthouse-core/report/v2/renderer/report-renderer.js
Expand Up @@ -140,20 +140,21 @@ class ReportRenderer {
_renderReport(report) {
const container = this._dom.createElement('div', 'lh-container');
const isSoloCategory = report.reportCategories.length === 1;
let scoreHeader;

container.appendChild(this._renderReportHeader(report)); // sticky header goes at the top.
container.appendChild(this._renderReportNav(report));

const reportSection = container.appendChild(this._dom.createElement('div', 'lh-report'));

const scoreHeaderClass = `lh-scores-header ${isSoloCategory ? 'lh-scores-header__solo' : ''}`;
const scoreHeader = reportSection.appendChild(this._dom.createElement('div', scoreHeaderClass));

if (!isSoloCategory) {
scoreHeader = reportSection.appendChild(this._dom.createElement('div', 'lh-scores-header'));
}
const categories = reportSection.appendChild(this._dom.createElement('div', 'lh-categories'));

for (const category of report.reportCategories) {
if (!isSoloCategory)
if (scoreHeader) {
scoreHeader.appendChild(this._categoryRenderer.renderScoreGauge(category));
}
categories.appendChild(this._categoryRenderer.render(category, report.reportGroups));
}

Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/report/v2/report-styles.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3ab552e

Please sign in to comment.