use node cloning method that works with IE (6,7) stable
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Thu, 03 Sep 2009 14:07:02 +0200
branchstable
changeset 3102 f2c4da6b008d
parent 3099 006be45923da
child 3103 1d09765ee720
child 3104 8881e45f55e3
use node cloning method that works with IE (6,7)
web/data/cubicweb.ajax.js
--- a/web/data/cubicweb.ajax.js	Wed Sep 02 15:44:40 2009 +0200
+++ b/web/data/cubicweb.ajax.js	Thu Sep 03 14:07:02 2009 +0200
@@ -397,15 +397,18 @@
     var children = doc.childNodes;
     if (!children.length) {
 	// no child (error cases) => return the whole document
-	return doc.cloneNode(true);
+	return jQuery(doc).clone().context;
     }
     children = stripEmptyTextNodes(children);
     if (children.length == 1) {
 	// only one child => return it
-	return children[0].cloneNode(true);
+	return jQuery(children[0]).clone().context;
     }
     // several children => wrap them in a single node and return the wrap
-    return DIV(null, map(methodcaller('cloneNode', true), children));
+    return DIV(null, map(function(node) {
+                           return jQuery(node).clone().context;
+                         },
+                         children));
 }
 
 function postJSON(url, data, callback) {