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

report(report-ui-features): Disable auto expansion of print option via report ui #3578

Merged
merged 4 commits into from
Nov 10, 2017
Merged
Show file tree
Hide file tree
Changes from all 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/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 @@ -343,7 +343,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