Switch to Modal printing
authorThomas Berezansky <tsbere@mvlc.org>
Mon, 12 Sep 2011 16:43:59 +0000 (12:43 -0400)
committerJason Etheridge <jason@esilibrary.com>
Tue, 4 Oct 2011 17:25:21 +0000 (13:25 -0400)
Prevents an OS-level race condition on window focus.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Open-ILS/xul/staff_client/chrome/content/util/print.js
Open-ILS/xul/staff_client/chrome/content/util/print_win.js

index 3d34502..ede2749 100644 (file)
@@ -174,16 +174,15 @@ util.print.prototype = {
                         print_url += '<script src="' + this.data.hash.aous['print.custom_js_file'] + '"></script>';
                     }
                     print_url += '</head><body onload="try{print_init(\'' + params.type + '\');}catch(E){alert(E);}">' + window.escape(msg.replace(/<script[^>]*>.*?<\/script>/gi,'')) + '</body></html>';
-                    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');
index 136b3bf..76f53f5 100644 (file)
@@ -14,7 +14,7 @@ function print_init(type) {
         print_check_noprint();
     }
     if (do_print) {
-        go_print();
+        go_print(window);
     } else {
         window.close();
     }