From 3c8dd8170987ca75fcdb547c0e5c226531c217cf Mon Sep 17 00:00:00 2001 From: phasefx Date: Mon, 11 Oct 2010 20:39:31 +0000 Subject: [PATCH] initialize these lists just once to prevent display glitch git-svn-id: svn://svn.open-ils.org/ILS/trunk@18269 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../server/circ/alternate_copy_summary.js | 23 +++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js b/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js index addc36457..13f0214fd 100644 --- a/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js +++ b/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js @@ -1,6 +1,8 @@ var error; var network; var data; +var transit_list; +var hold_list; function my_init() { try { @@ -39,6 +41,16 @@ function my_init() { ); } + JSAN.use('circ.util'); + JSAN.use('util.list'); + + var columns = circ.util.transit_columns({}); + transit_list = new util.list('transit'); + transit_list.init( { 'columns' : columns, 'map_row_to_columns' : circ.util.std_map_row_to_columns(), }); + + hold_list = new util.list('hold'); + hold_list.init( { 'columns' : columns, 'map_row_to_columns' : circ.util.std_map_row_to_columns(), }); + // timeout so xulG gets a chance to get pushed in setTimeout( function () { xulG.from_item_details_new = false; load_item(); }, @@ -289,11 +301,9 @@ function load_item() { set("hold_transit_copy", ''); if (details.transit) { - JSAN.use('circ.util'); var columns = circ.util.transit_columns({}); - JSAN.use('util.list'); var list = new util.list('transit'); - list.init( { 'columns' : columns, 'map_row_to_columns' : circ.util.std_map_row_to_columns(), }); - list.append( { 'row' : { 'my' : { 'atc' : details.transit, } } }); + transit_list.clear(); + transit_list.append( { 'row' : { 'my' : { 'atc' : details.transit, } } }); var transit_copy_status = typeof details.transit.copy_status() == 'object' ? details.transit.copy_status() : data.hash.ccs[ details.transit.copy_status() ]; set("transit_copy_status", transit_copy_status.name() ); @@ -593,9 +603,8 @@ function load_item() { } ); - JSAN.use('util.list'); var list = new util.list('hold'); - list.init( { 'columns' : columns, 'map_row_to_columns' : circ.util.std_map_row_to_columns(), }); - list.append( { 'row' : { 'my' : { 'ahr' : better_fleshed_hold_blob.hold, 'acp' : details.copy, 'status' : status_robj, } } }); + hold_list.clear(); + hold_list.append( { 'row' : { 'my' : { 'ahr' : better_fleshed_hold_blob.hold, 'acp' : details.copy, 'status' : status_robj, } } }); JSAN.use('patron.util'); var au_obj = patron.util.retrieve_fleshed_au_via_id( ses(), details.hold.usr() ); -- 2.11.0