[open-ils-commits] r7718 - branches/rel_1_2/Open-ILS/xul/staff_client/chrome/content/util

svn at svn.open-ils.org svn at svn.open-ils.org
Sun Aug 26 01:42:17 EDT 2007


Author: phasefx
Date: 2007-08-26 01:36:53 -0400 (Sun, 26 Aug 2007)
New Revision: 7718

Modified:
   branches/rel_1_2/Open-ILS/xul/staff_client/chrome/content/util/list.js
Log:
backport to 1.2 a fix for single-row refresh and on_all_fleshed callback

Modified: branches/rel_1_2/Open-ILS/xul/staff_client/chrome/content/util/list.js
===================================================================
--- branches/rel_1_2/Open-ILS/xul/staff_client/chrome/content/util/list.js	2007-08-26 05:33:11 UTC (rev 7717)
+++ branches/rel_1_2/Open-ILS/xul/staff_client/chrome/content/util/list.js	2007-08-26 05:36:53 UTC (rev 7718)
@@ -327,6 +327,7 @@
 				rparams.my_node.setAttribute(i,params.attributes[i]);
 			}
 		}
+        this.row_count.fleshed--;
 		return rparams;
 	},
 
@@ -410,7 +411,7 @@
 						if (treerow.getAttribute('fleshed') == 'true') return; /* already fleshed */
 						treerow.setAttribute('fleshed','true');
 						obj.row_count.fleshed++;
-						if (obj.row_count.fleshed == obj.row_count.total) {
+						if (obj.row_count.fleshed >= obj.row_count.total) {
 							if (typeof obj.on_all_fleshed == 'function') {
 								setTimeout( function() { obj.on_all_fleshed(); }, 0 );
 							}
@@ -468,7 +469,7 @@
 					treerow.setAttribute('retrieved','true');
 					treerow.setAttribute('fleshed','true');
 					obj.row_count.fleshed++;
-					if (obj.row_count.fleshed == obj.row_count.total) {
+					if (obj.row_count.fleshed >= obj.row_count.total) {
 						if (typeof obj.on_all_fleshed == 'function') {
 							setTimeout( function() { obj.on_all_fleshed(); }, 0 );
 						}
@@ -560,7 +561,7 @@
 						if (treerow.getAttribute('fleshed') == 'true') return; /* already fleshed */
 						treerow.setAttribute('fleshed','true');
 						obj.row_count.fleshed++;
-						if (obj.row_count.fleshed == obj.row_count.total) {
+						if (obj.row_count.fleshed >= obj.row_count.total) {
 							if (typeof obj.on_all_fleshed == 'function') {
 								setTimeout( function() { obj.on_all_fleshed(); }, 0 );
 							}
@@ -618,7 +619,7 @@
 					treerow.setAttribute('retrieved','true');
 					treerow.setAttribute('fleshed','true');
 					obj.row_count.fleshed++;
-					if (obj.row_count.fleshed == obj.row_count.total) {
+					if (obj.row_count.fleshed >= obj.row_count.total) {
 						if (typeof obj.on_all_fleshed == 'function') {
 							setTimeout( function() { obj.on_all_fleshed(); }, 0 );
 						}
@@ -765,15 +766,15 @@
 	'_full_retrieve_tree' : function(params) {
 		var obj = this;
 		try {
-			if (obj.row_count.total == obj.row_count.fleshed) {
-				//alert('Full retrieve... tree seems to be in sync\n' + js2JSON(obj.row_count));
+			if (obj.row_count.fleshed >= obj.row_count.total) {
+				dump('Full retrieve... tree seems to be in sync\n' + js2JSON(obj.row_count) + '\n');
 				if (typeof obj.on_all_fleshed == 'function') {
 					setTimeout( function() { obj.on_all_fleshed(); }, 0 );
 				} else {
-					alert('.full_retrieve called with no callback?');
+					dump('.full_retrieve called with no callback?' + '\n');
 				}
 			} else {
-				//alert('Full retrieve... syncing tree' + js2JSON(obj.row_count));
+				dump('Full retrieve... syncing tree' + js2JSON(obj.row_count) + '\n');
 				JSAN.use('util.widgets');
 				var nodes = obj.treechildren.childNodes;
 				for (var i = 0; i < nodes.length; i++) {



More information about the open-ils-commits mailing list