[open-ils-commits] r7873 - in trunk/Open-ILS/xul/staff_client: chrome/content/util server/circ

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Oct 8 17:00:19 EDT 2007


Author: phasefx
Date: 2007-10-08 16:48:46 -0400 (Mon, 08 Oct 2007)
New Revision: 7873

Modified:
   trunk/Open-ILS/xul/staff_client/chrome/content/util/list.js
   trunk/Open-ILS/xul/staff_client/server/circ/copy_status.js
Log:
handle copy status list refresh if the barcode for a row changes.. need to test the list.js changes for regressions in other interfaces

Modified: trunk/Open-ILS/xul/staff_client/chrome/content/util/list.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/util/list.js	2007-10-08 20:01:45 UTC (rev 7872)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/util/list.js	2007-10-08 20:48:46 UTC (rev 7873)
@@ -429,7 +429,7 @@
 							// if current row is selected, send another select event to re-sync data that the client code fetches on selects
 							if ( obj.node.view.selection.isSelected( idx ) ) {
 								dump('dispatching select event for on_retrieve for idx = ' + idx + '\n');
-								util.widgets.dispatch('select',params.row_node);
+								util.widgets.dispatch('select',obj.node);
 							}
 						} catch(E) {
 							alert('fixme2: ' + E);
@@ -579,7 +579,7 @@
 							// if current row is selected, send another select event to re-sync data that the client code fetches on selects
 							if ( obj.node.view.selection.isSelected( idx ) ) {
 								dump('dispatching select event for on_retrieve for idx = ' + idx + '\n');
-								util.widgets.dispatch('select',params.row_node);
+								util.widgets.dispatch('select',obj.node);
 							}
 						} catch(E) {
 							alert('fixme2: ' + E);
@@ -653,6 +653,8 @@
 
 		setTimeout( function() { obj.auto_retrieve(); }, 0 );
 
+        JSAN.use('util.widgets'); util.widgets.dispatch('select',obj.node);
+
 		return params;
 	},
 
@@ -811,7 +813,7 @@
 						params.row = row;
 						obj._map_row_to_listcell(params,listitem);
 						obj.node.appendChild( listitem );
-						util.widgets.dispatch('select',params.row_node);
+						util.widgets.dispatch('select',obj.node);
 					}
 
 					if (typeof params.retrieve_row == 'function') {

Modified: trunk/Open-ILS/xul/staff_client/server/circ/copy_status.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/copy_status.js	2007-10-08 20:01:45 UTC (rev 7872)
+++ trunk/Open-ILS/xul/staff_client/server/circ/copy_status.js	2007-10-08 20:48:46 UTC (rev 7873)
@@ -13,7 +13,7 @@
 
 circ.copy_status.prototype = {
 	'selection_list' : [],
-	'list_barcode_map' : {},
+	'list_copyid_map' : {},
 
 	'init' : function( params ) {
 
@@ -1025,15 +1025,23 @@
 					if (!refresh) {
 						var nparams = obj.list.append(params);
 						if (!document.getElementById('trim_list').checked) {
-							if (typeof obj.list_barcode_map[barcode] == 'undefined') obj.list_barcode_map[barcode] =[];
-							obj.list_barcode_map[barcode].push(nparams);
+							if (typeof obj.list_copyid_map[details.copy.id()] == 'undefined') obj.list_copyid_map[details.copy.id()] =[];
+							obj.list_copyid_map[details.copy.id()].push(nparams);
 						}
 					} else {
 						if (!document.getElementById('trim_list').checked) {
-							for (var i = 0; i < obj.list_barcode_map[barcode].length; i++) {
-								params.my_node = obj.list_barcode_map[barcode][i].my_node;
-								obj.list.refresh_row(params);
-							}
+                            if (typeof obj.list_copyid_map[details.copy.id()] != 'undefined') {
+                                for (var i = 0; i < obj.list_copyid_map[details.copy.id()].length; i++) {
+                                    if (typeof obj.list_copyid_map[details.copy.id()][i] == 'undefined') {
+                                        obj.list.append(params);
+                                    } else {
+                                        params.my_node = obj.list_copyid_map[details.copy.id()][i].my_node;
+                                        obj.list.refresh_row(params);
+                                    }
+                                }
+                            } else {
+							    obj.list.append(params);
+                            }
 						} else {
 							obj.list.append(params);
 						}



More information about the open-ils-commits mailing list