From: Thomas Berezansky Date: Mon, 12 Sep 2011 16:43:59 +0000 (-0400) Subject: Switch to Modal printing X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=22e07285e77d4b31e0904d33c2572b856305c7f8;p=evergreen%2Ftadl.git Switch to Modal printing Prevents an OS-level race condition on window focus. Signed-off-by: Thomas Berezansky Signed-off-by: Jason Etheridge --- diff --git a/Open-ILS/xul/staff_client/chrome/content/util/print.js b/Open-ILS/xul/staff_client/chrome/content/util/print.js index 3d34502019..ede2749235 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/print.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/print.js @@ -174,16 +174,15 @@ util.print.prototype = { print_url += ''; } print_url += '' + window.escape(msg.replace(/]*>.*?<\/script>/gi,'')) + ''; - w = obj.win.openDialog(print_url,'receipt_temp','chrome,resizable,minimizable', null, { "data" : params.data, "list" : params.list}, function() { + obj.win.openDialog(print_url,'receipt_temp','chrome,resizable,modal', null, { "data" : params.data, "list" : params.list}, function(w) { try { obj.NSPrint(w, silent, params); } catch(E) { obj.error.standard_unexpected_error_alert("Print Error in util.print.simple. After this dialog we'll try a second print attempt. content_type = " + content_type,E); w.print(); } - w.minimize(); w.close(); + w.close(); }); - w.minimize(); break; default: w = obj.win.open('data:' + content_type + ',' + window.escape(msg),'receipt_temp','chrome,resizable'); diff --git a/Open-ILS/xul/staff_client/chrome/content/util/print_win.js b/Open-ILS/xul/staff_client/chrome/content/util/print_win.js index 136b3bff2f..76f53f5877 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/print_win.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/print_win.js @@ -14,7 +14,7 @@ function print_init(type) { print_check_noprint(); } if (do_print) { - go_print(); + go_print(window); } else { window.close(); }