Skip to content

Commit

Permalink
report: extract init() function from report-template (#8228)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish authored Apr 12, 2019
1 parent 48ee485 commit 2553a24
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lighthouse-core/report/html/report-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</script>
<script>window.__LIGHTHOUSE_JSON__ = %%LIGHTHOUSE_JSON%%;</script>
<script>
window.addEventListener('DOMContentLoaded', _ => {
function __initLighthouseReport__() {
const dom = new DOM(document);
const renderer = new ReportRenderer(dom);

Expand All @@ -47,7 +47,8 @@
// is in the document.
const features = new ReportUIFeatures(dom);
features.initFeatures(window.__LIGHTHOUSE_JSON__);
});
}
window.addEventListener('DOMContentLoaded', __initLighthouseReport__);

document.addEventListener('lh-analytics', e => {
if (window.ga) {
Expand Down

0 comments on commit 2553a24

Please sign in to comment.