Skip to content

Commit

Permalink
report: Add print summary and print expanded options (GoogleChrome#3578)
Browse files Browse the repository at this point in the history
  • Loading branch information
karanjthakkar authored and christhompson committed Nov 17, 2017
1 parent f481741 commit 5411289
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 6 additions & 2 deletions lighthouse-core/report/v2/renderer/report-ui-features.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,12 @@ class ReportUIFeatures {
case 'copy':
this.onCopyButtonClick();
break;
case 'print':
case 'print-summary':
this.collapseAllDetails();
this.closeExportDropdown();
self.print();
break;
case 'print-expanded':
this.expandAllDetails();
this.closeExportDropdown();
self.print();
Expand Down Expand Up @@ -257,7 +262,6 @@ class ReportUIFeatures {
*/
printShortCutDetect(e) {
if ((e.ctrlKey || e.metaKey) && e.keyCode === 80) { // Ctrl+P
this.expandAllDetails();
this.closeExportDropdown();
}
}
Expand Down
3 changes: 2 additions & 1 deletion lighthouse-core/report/v2/templates.html
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,8 @@ <h1 class="leftnav__header__title">Lighthouse</h1>
<div class="lh-export">
<button class="report-icon report-icon--share lh-export__button" title="Export report"></button>
<div class="lh-export__dropdown">
<a href="#" class="report-icon report-icon--print" data-action="print">Print...</a>
<a href="#" class="report-icon report-icon--print" data-action="print-summary">Print Summary</a>
<a href="#" class="report-icon report-icon--print" data-action="print-expanded">Print Expanded</a>
<a href="#" class="report-icon report-icon--copy" data-action="copy">Copy JSON</a>
<a href="#" class="report-icon report-icon--download" data-action="save-html">Save as HTML</a>
<a href="#" class="report-icon report-icon--download" data-action="save-json">Save as JSON</a>
Expand Down

0 comments on commit 5411289

Please sign in to comment.