resources/Editors/Editor.Roo.LayoutDialog.bjs
[app.Builder.js] / resources / roo.builder.js
index 6fb9ed6..bf08085 100644 (file)
@@ -35,12 +35,12 @@ Builder  = {
         
         
         traverseDOMTree : function(cb, currentElement, depth) {
-            if (!currentElement) {
+            if (!currentElement ) {
                 
                 return;
             }
             //console.log(currentElement);
-            if (currentElement.className.match(/roo-dynamic/)) {
+            if (currentElement.className && currentElement.className.match(/roo-dynamic/)) {
                 return;
             }
             
@@ -54,6 +54,9 @@ Builder  = {
                 return;
             
             }
+            if (nodeName.match(/^#/)) { // comments?
+                return;
+            }
              
             
             
@@ -62,8 +65,13 @@ Builder  = {
                 return;
             }
             if (nodeName != 'BODY') {
-                
-            
+                //Roo.log(currentElement);
+                if (currentElement.hasAttribute('flexy:include')) {
+
+
+                    cb( '<flexy:include src="'+currentElement.getAttribute('flexy:include')+'"></flexy:include>');
+                    return;
+                }
             
                 var i = 0;
               // Prints the node tagName, such as <A>, <IMG>, etc
@@ -90,9 +98,7 @@ Builder  = {
             } else {
                 tagName = false;
             }
-            if (currentElement.hasAttribute('flexy:include')) {
-                cb( tagName ? "</"+tagName+">" : '');
-            }
+            
             
             // Traverse the tree
             i = 0;
@@ -325,7 +331,7 @@ Builder  = {
             //Roo.log("add flexy:if");
             tree.el.attr('flexy:include', tree['flexy:include']);
         }
-        Roo.log("Add xtype")
+        //Roo.log("Add xtype")
         tree.el.attr('xtype', tree['|xns'] + '.' +  tree['xtype']);
         if (!tree.items || !tree.items.length) { return; }