[open-ils-commits] r15222 - trunk/Open-ILS/xul/staff_client/chrome/content/util (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Dec 22 11:51:01 EST 2009
Author: phasefx
Date: 2009-12-22 11:50:58 -0500 (Tue, 22 Dec 2009)
New Revision: 15222
Modified:
trunk/Open-ILS/xul/staff_client/chrome/content/util/list.js
Log:
more node preservation in list.js, and eliminate the Retrieving... label for rows that have already been rendered previously and are merely changing their values
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/util/list.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/util/list.js 2009-12-22 15:32:51 UTC (rev 15221)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/util/list.js 2009-12-22 16:50:58 UTC (rev 15222)
@@ -581,11 +581,15 @@
}
}
}
- var delete_me = [];
- for (var i in treeitem.childNodes) if (treeitem.childNodes[i].nodeName == 'treerow') delete_me.push(treeitem.childNodes[i]);
- for (var i = 0; i < delete_me.length; i++) treeitem.removeChild(delete_me[i]);
+ //var delete_me = [];
+ //for (var i in treeitem.childNodes) if (treeitem.childNodes[i].nodeName == 'treerow') delete_me.push(treeitem.childNodes[i]);
+ //for (var i = 0; i < delete_me.length; i++) treeitem.removeChild(delete_me[i]);
+ var prev_treerow = treeitem.firstChild; /* FIXME: worry about hierarchal lists like copy_browser? */
var treerow = document.createElement('treerow');
- treeitem.appendChild( treerow );
+ while (prev_treerow.firstChild) {
+ treerow.appendChild( prev_treerow.removeChild( prev_treerow.firstChild ) );
+ }
+ treeitem.replaceChild( treerow, prev_treerow );
treerow.setAttribute('retrieve_id',params.retrieve_id);
if (params.row_properties) treerow.setAttribute('properties',params.row_properties);
@@ -728,15 +732,21 @@
cols_idx++;
}
*/
+ var create_treecells = treerow.childNodes.length == 0;
for (var i = 0; i < obj.columns.length; i++) {
- var treecell = document.createElement('treecell'); treecell.setAttribute('label',document.getElementById('offlineStrings').getString('list.row_retrieving'));
- treerow.appendChild(treecell);
+ var treecell = create_treecells ? document.createElement('treecell') : treerow.childNodes[i];
+ if (treecell) {
+ if (create_treecells) {
+ treecell.setAttribute('label',document.getElementById('offlineStrings').getString('list.row_retrieving'));
+ treerow.appendChild(treecell);
+ }
+ }
}
/*
dump('\t' + cols_idx + '\n');
*/
} catch(E) {
- alert(E);
+ alert('Error in list.js, put_retrieving_label(): ' + E);
}
},
More information about the open-ils-commits
mailing list