web/data/cubicweb.ajax.js
branchstable
changeset 4208 b2826afdaf8c
parent 4175 92a10d2a09af
child 4830 10e8bc190695
--- a/web/data/cubicweb.ajax.js	Mon Jan 04 19:02:09 2010 +0100
+++ b/web/data/cubicweb.ajax.js	Tue Jan 05 17:04:29 2010 +0100
@@ -424,11 +424,16 @@
  * takes a list of DOM nodes and removes all empty text nodes
  */
 function stripEmptyTextNodes(nodelist) {
+    /* this DROPS empty text nodes */
     var stripped = [];
     for (var i=0; i < nodelist.length; i++) {
         var node = nodelist[i];
-        if (isTextNode(node) && !node.textContent.strip()) {
-            continue;
+        if (isTextNode(node)) {
+             /* all browsers but FF -> innerText, FF -> textContent  */
+             var text = node.innerText || node.textContent;
+             if (text && !text.strip()) {
+               continue;
+             }
         } else {
             stripped.push(node);
         }