Skip to content

Commit

Permalink
assign print event to print icon
Browse files Browse the repository at this point in the history
  • Loading branch information
pmusaraj committed Sep 2, 2016
1 parent 934a12d commit b29838b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
12 changes: 10 additions & 2 deletions jsapp/js/components/reports.es6
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,11 @@ var Reports = React.createClass({
showExpandedReport: !this.state.showExpandedReport,
});
},
launchPrinting () {
this.toggleExpandedReports();
setTimeout(window.print, 150);
setTimeout(this.toggleExpandedReports, 300);
},
renderReportButtons () {
return (
<bem.FormView__reportButtons>
Expand Down Expand Up @@ -398,11 +403,14 @@ var Reports = React.createClass({
</ul>

<button className="mdl-button mdl-js-button mdl-button--icon report-button__expand"
onClick={this.toggleExpandedReports} data-tip={t('Expand')}>
onClick={this.toggleExpandedReports}
data-tip={t('Expand')}>
<i className="k-icon-expand" />
</button>

<button className="mdl-button mdl-js-button mdl-button--icon report-button__print" data-tip={t('Print')}>
<button className="mdl-button mdl-js-button mdl-button--icon report-button__print"
onClick={this.launchPrinting}
data-tip={t('Print')}>
<i className="k-icon-print" />
</button>

Expand Down
5 changes: 0 additions & 5 deletions jsapp/scss/libs/_print.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@
.k-drawer + .mdl-layout__content {
margin-left: 0px;
}
.mdl-layout__content {
position: static;
height: inherit !important;
display: block !important;
}
.form-view__reportButtons {
display: none;
}
Expand Down

0 comments on commit b29838b

Please sign in to comment.