Bug 6126: Slip print doesn't work on Webkit based browsers

Wrap window.print();window.close(); with a function called when body has finished loading. Prevents webkit from closing before page is loaded and print dialog presented to the user.

Signed-off-by: Jared Camins-Esakov <jcamins@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This commit is contained in:
Tomás Cohen Arazi 2011-04-12 08:45:22 -04:00 committed by Chris Cormack
parent 6152b624f7
commit 97712c2cca
3 changed files with 9 additions and 3 deletions

View file

@ -5,11 +5,13 @@
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/print.css" />
<script language="javascript">
function printThenClose() {
window.print();
window.close();
}
</script>
</head>
<body>
<body onload="printThenClose();">
<div id="receipt">

View file

@ -4,11 +4,13 @@
<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon %][% ELSE %][% themelang %]/includes/favicon.ico[% END %]" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/printreceiptinvoice.css" />
<script language="javascript">
function printThenClose() {
window.print();
window.close();
}
</script>
</head>
<body>
<body onload="printThenClose();">
<div id="receipt">
<!-- The table with the account items -->

View file

@ -4,11 +4,13 @@
<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon %][% ELSE %][% themelang %]/includes/favicon.ico[% END %]" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/printreceiptinvoice.css" />
<script language="javascript">
function printThenClose() {
window.print();
window.close();
}
</script>
</head>
<body>
<body onload="printThenClose();">
<div id="receipt">
<!-- The table with the account items -->