Bug 27282: Add window.onafterprint function

TO TEST:
-set up a new list with a few items
-go to /cgi-bin/koha/virtualshelves/shelves.pl and view that list.
-Click 'Print List' in Chrome.
-The tab opens but immediately closes itself.
-Apply patch and clear cache
-Try again, the print dialouge remains open

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Lucas Gass 2020-12-18 17:28:54 +00:00 committed by Jonathan Druart
parent 61d8ec5075
commit fae72d031a
1 changed files with 4 additions and 1 deletions

View File

@ -482,7 +482,10 @@
<script>
$( document ).ready(function() {
window.print();
setTimeout('window.close()', 1);
window.onafterprint = function () {
window.close();
}
setTimeout('window.close()', 1000); // Hack for Chrome < 63
});
</script>
[% END %]