Allow system printing to work normally by delaying stylesheet inclusion
authorMike Rylander <mrylander@gmail.com>
Fri, 4 Nov 2016 17:55:23 +0000 (13:55 -0400)
committerKathy Lussier <klussier@masslnc.org>
Tue, 22 Nov 2016 19:10:05 +0000 (14:10 -0500)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/src/templates/staff/base.tt2
Open-ILS/web/js/ui/default/staff/services/print.js

index 7f4c64a..93ada15 100644 (file)
@@ -20,7 +20,6 @@
     [% END %]
     <link rel="stylesheet" href="[% ctx.base_path %]/staff/css/cat.css" />
     <link rel="stylesheet" href="[% ctx.base_path %]/staff/css/style.css" />
-    <link rel="stylesheet" href="[% ctx.base_path %]/staff/css/print.css" type="text/css" media="print" />
   </head>
   <body>
     <toast></toast>
index fa60193..960eb1d 100644 (file)
@@ -6,8 +6,8 @@
 angular.module('egCoreMod')
 
 .factory('egPrint',
-       ['$q','$window','$timeout','$http','egHatch','egAuth','egIDL','egOrg',
-function($q , $window , $timeout , $http , egHatch , egAuth , egIDL , egOrg) {
+       ['$q','$window','$timeout','$http','egHatch','egAuth','egIDL','egOrg','egEnv',
+function($q , $window , $timeout , $http , egHatch , egAuth , egIDL , egOrg , egEnv) {
 
     var service = {};
 
@@ -160,14 +160,14 @@ function($q , $window , $timeout , $http , egHatch , egAuth , egIDL , egOrg) {
             scope.elm = element;
         },
         controller : 
-                   ['$scope','$q','$window','$timeout','egHatch','egPrint',
-            function($scope , $q , $window , $timeout , egHatch , egPrint) {
+                   ['$scope','$q','$window','$timeout','egHatch','egPrint','egEnv',
+            function($scope , $q , $window , $timeout , egHatch , egPrint , egEnv) {
 
                 egPrint.ingest_print_content = function(type, content, printScope) {
 
                     if (type == 'text/csv' || type == 'text/plain') {
                         // preserve newlines, spaces, etc.
-                        content = '<pre>' + content + '</pre>';
+                        content = '<link rel="stylesheet" href="'+ egEnv.basePath + 'css/print.css" type="text/css" media="print" /><pre>' + content + '</pre>';
                     }
 
                     $scope.elm.html(content);