Author: dmorozov
Date: 2007-06-28 15:08:24 -0400 (Thu, 28 Jun 2007)
New Revision: 1381
Modified:
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/common/utils/Utils.js
Log:
Fix DOMmodel update under FireFox
Modified:
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/common/utils/Utils.js
===================================================================
---
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/common/utils/Utils.js 2007-06-28
19:04:23 UTC (rev 1380)
+++
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/common/utils/Utils.js 2007-06-28
19:08:24 UTC (rev 1381)
@@ -45,35 +45,44 @@
if(target && src) {
Utils.DOM.Event.removeListeners(target);
- if (ClientUILib.isIE) {
+ //if (ClientUILib.isIE) {
var theDoc = document;
- var createEl = theDoc.createElement;
+ //var createEl = theDoc.createElement;
- row = createEl( "TR" );
+ row = theDoc.createElement( "TR" );
Utils.DOM.copyAttributes(row, src);
- var tdSrc, tdNode;
+ var tdSrc, tdNode, subNode;
var childs = src.childNodes;
var ccount = childs.length;
- for(var k=0; k<ccount; k++) {
- tdSrc = childs[k];
- tdNode = createEl( "TD" );
+ var tcount = target.childNodes.length;
+ for(var k=0; k<tcount; k++) {
+ tdSrc = k<ccount ? childs[k] : null;
+ tdNode = theDoc.createElement( "TD" );
//Utils.DOM.copyAttributes(tdNode, tdSrc);
tdNode.className = "ClientUI_Grid_BC";
- row.insertBefore(tdNode, null);
- innerHTML = [];
- innerCount = tdSrc.childNodes.length;
- for(j=0; j<innerCount; j++) {
- innerHTML.push(tdSrc.childNodes[j].xml);
+ if(tdSrc) {
+ if(tdSrc.innerHTML) {
+ tdNode.innerHTML = tdSrc.innerHTML;
+ }
+ else {
+ innerHTML = [];
+ innerCount = tdSrc.childNodes.length;
+ for(j=0; j<innerCount; j++) {
+ subNode = tdSrc.childNodes[j];
+ innerHTML.push(subNode.xml);
+ }
+ tdNode.innerHTML = innerHTML.join("");
+ }
}
- tdNode.innerHTML = innerHTML.join("");
+ row.insertBefore(tdNode, null);
}
target.parentNode.replaceChild(row, target);
return row;
- } else {
+ /*} else {
Element.hide(target);
Utils.DOM.Event.removeListeners(target);
@@ -82,7 +91,7 @@
Utils.DOM.copyAttributes(target, src);
Element.show(target);
return target;
- }
+ }*/
}
else {
if(!target)
Show replies by date