Skip to content

Commit

Permalink
Merge pull request #103 from tomassurek/patch-1
Browse files Browse the repository at this point in the history
Fix for the print window closing in FF
  • Loading branch information
broem authored Apr 11, 2021
2 parents 9a9b2e6 + b771906 commit ea6464f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib/ngx-print.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,12 @@ public returnStyleValues() {
function triggerPrint(event) {
window.removeEventListener('load', triggerPrint, false);
setTimeout(function() {
window.print();
setTimeout(function() { window.close(); }, 0);
closeWindow(window.print());
}, ${this.printDelay});
}
function closeWindow(){
window.close();
}
window.addEventListener('load', triggerPrint, false);
</script>
</body>
Expand Down

0 comments on commit ea6464f

Please sign in to comment.