Skip to content

Commit

Permalink
Merge pull request #174 from MarkAdamsGarmin/master
Browse files Browse the repository at this point in the history
Make closeWindow still print(), fix test for standalone.
  • Loading branch information
Core121 authored Nov 30, 2023
2 parents 367861e + 36dba82 commit b5559ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/ngx-print.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,12 @@ export class NgxPrintDirective {
<script defer>
function triggerPrint(event) {
window.removeEventListener('load', triggerPrint, false);
${this.previewOnly || !this.closeWindow ? '' : `setTimeout(function() {
${this.previewOnly ? '' : `setTimeout(function() {
closeWindow(window.print());
}, ${this.printDelay});`}
}
function closeWindow(){
window.close();
${this.closeWindow ? 'window.close();' : ''}
}
window.addEventListener('load', triggerPrint, false);
</script>
Expand Down

0 comments on commit b5559ce

Please sign in to comment.