From 0a762feebd9ddb45584182ea438bd6693e524cdf Mon Sep 17 00:00:00 2001 From: Lebbeous Fogle-Weekley Date: Thu, 20 Feb 2014 12:21:57 -0500 Subject: [PATCH] LP#1282704: Serials: in routing lists, avoid extra page breaks wasting paper at print time If you're using batch receive, and you have two copies (and therefore two streams) that you're receiving with the Routing List? checkbox checked, but only one of those streams actually has a routing list, you'll note before this patch is applied that you get an extra page of blank paper if you print the routing list that pops up. This fixes that. Signed-off-by: Lebbeous Fogle-Weekley Signed-off-by: Galen Charlton --- .../web/js/ui/default/serial/print_routing_list_users.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Open-ILS/web/js/ui/default/serial/print_routing_list_users.js b/Open-ILS/web/js/ui/default/serial/print_routing_list_users.js index 9d5f85247c..917ff75afb 100644 --- a/Open-ILS/web/js/ui/default/serial/print_routing_list_users.js +++ b/Open-ILS/web/js/ui/default/serial/print_routing_list_users.js @@ -9,6 +9,8 @@ function ListRenderer() { var self = this; this.render = function() { + var rendered_something = false; + for (var i = 0; i < this.streams.length; i++) { var stream = this.streams[i]; @@ -35,7 +37,7 @@ function ListRenderer() { this.render_users(stream, list); - if (i) { + if (rendered_something) { dojo.create( "hr", {"style": "page-break-after: always"}, this.target, "last" @@ -43,6 +45,7 @@ function ListRenderer() { } dojo.place(list, this.target, "last"); + rendered_something = true; } return this; /* for chaining */ -- 2.43.2