DataObjects/builder.sql
[Pman.Builder] / Pman.Builder.View.js
index 6720838..8364fab 100644 (file)
@@ -51,8 +51,6 @@ Pman.Builder.View = {
         //this.doc = iframe.contentDocument || iframe.contentWindow.document;
         
         
-        
-        
     },
     
     clearAll : function(isAuto) {
@@ -75,8 +73,6 @@ Pman.Builder.View = {
     toHTML : function ()  {
         var ret = '';
         Roo.select('body > div',true).each(function(el) {
-            Roo.log('el');
-            Roo.log(el);
             this.traverseDOMTree(function(s) { ret+=s; }, el.dom, 1);
             ret+="\n";
         }, this);
@@ -99,6 +95,11 @@ Pman.Builder.View = {
                 return;
             
             }
+            if(nodeName == 'BR'){
+                cb("<BR/>");
+                return;
+            }
+            
             var i = 0;
           // Prints the node tagName, such as <A>, <IMG>, etc
             if (tagName) {
@@ -249,9 +250,15 @@ Pman.Builder.View = {
         
         // add xattr data?
         if (add_xattr) {
-            cfg.xattr = {
-                xtype : cfg['|xns'] + '.' + cfg.xtype 
-            };
+            
+            if(typeof(cfg.xattr) != 'undefined'){
+                
+                cfg.xattr.xtype = cfg['|xns'] + '.' + cfg.xtype;
+            }else{
+                cfg.xattr = {
+                    xtype : cfg['|xns'] + '.' + cfg.xtype 
+                };
+            }
             
         }
         
@@ -405,23 +412,20 @@ Pman.Builder.View = {
         }
         if (cfg.items[0]['|xns'] == 'Roo.bootstrap') {
             
-            
-            
+            if (cfg.items[0].xtype =='Modal' ) {
+                this.bootstrapModal = Roo.factory(cfg.items[0]);
+                this.bootstrapModal.show();
+                return;
+            }
             Roo.log("bootstrap build!?");
             var top = new Roo.bootstrap.Body({});
             top.onRender(false,false);
-            Roo.log("config before is now");
             
-            Roo.log(top);
-            this.bootstrapModal = top.addxtype(cfg.items[0]).items[0];
-            Roo.log("config after is now");
+            this.bootstrapModal = top.addxtype(cfg.items[0]);
             
-            Roo.log(top);
             this.applyFlexy(top);
             
-            if (cfg.items[0].xtype =='Modal' ) {
-                this.bootstrapModal.show();
-            }
+            
             
             return;
         }
@@ -462,7 +466,7 @@ Pman.Builder.View = {
             if (!e.dom.href.match(/bootstrap\.\min.css$/)) {
                 return;
             }
-            e.dom.setAttribute('href', rootURL +'/bootswatch/' + name + '/bootstrap.min.css' );
+            e.dom.setAttribute('href', rootURL +'/themes/' + name + '/bootstrap.min.css' );
             
         
        });
@@ -476,7 +480,10 @@ Pman.Builder.View = {
         if (typeof(tree['flexy:if']) != 'undefined') {
             tree.el.attr('flexy:if', tree['flexy:if']);
         }
-        if (typeof(tree.items) == 'undefinded' || !tree.items.length) { return; }
+        if (typeof(tree['flexy:nameuses']) != 'undefined') {
+            (tree.inputEl() !== 'undefined') ? tree.inputEl().attr('flexy:nameuses', tree['flexy:nameuses']) : tree.el.attr('flexy:nameuses', tree['flexy:nameuses']);
+        }
+        if (!tree.items || !tree.items.length) { return; }
         
         for (var i = 0; i < tree.items.length; i++){
             this.applyFlexy(tree.items[i]);