roojs-bootstrap.js
authorAlan Knowles <alan@roojs.com>
Tue, 10 Mar 2015 10:57:27 +0000 (18:57 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 10 Mar 2015 10:57:27 +0000 (18:57 +0800)
roojs-bootstrap-debug.js

roojs-bootstrap-debug.js
roojs-bootstrap.js

index aabb605..bb86b0a 100644 (file)
@@ -225,11 +225,15 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent,  {
             }
            
             
-               
+            skip_children = false;
             // if object has flexy:if - then it may or may not be rendered.
             if (build_from_html && has_flexy && !cn.el &&  cn.can_build_overlaid) {
                 // skip a flexy if element.
                 Roo.log('skipping render');
+                if (!cn.el) {
+                    skip_children = true;
+                }
+                
              } else {
                  
                 // actually if flexy:foreach is found, we really want to create 
@@ -262,10 +266,12 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent,  {
         
         //Roo.log(items.length);
             // add the items..
-        for(var i =0;i < items.length;i++) {
-            nitems.push(cn.addxtype(Roo.apply({}, items[i])));
+        if (!skip_children) {    
+            for(var i =0;i < items.length;i++) {
+                nitems.push(cn.addxtype(Roo.apply({}, items[i])));
+            }
         }
-       
+        
         cn.items = nitems;
        
         return cn;
@@ -3706,7 +3712,7 @@ Roo.extend(Roo.bootstrap.NavItem, Roo.bootstrap.Component,  {
                 p.setActiveItem(this);
             }
         }
-        // if parent is a navbarheader....
+        // if parent is a navbarheader....- and link is probably a '#' page ref.. then remove the expanded menu.
         if (p.parentType == 'NavHeaderbar' && !this.menu) {
             // remove the collapsed menu expand...
             p.parent().el.select('.navbar-collapse',true).removeClass('in');  
index 7949418..ae3f1c6 100644 (file)
@@ -3,7 +3,8 @@ Roo.bootstrap=Roo.bootstrap||{};Roo.bootstrap.Component=function(A){Roo.bootstra
 this.el=ct.createChild(B,A);if(this.tabIndex!==undefined){this.el.dom.setAttribute('tabIndex',this.tabIndex);}
 this.initEvents();},getChildContainer:function(){return this.el;},addxtype:function(A,B){var cn=this;cn=Roo.factory(A);cn.parentType=this.xtype;cn.parentId=this.id;B=(typeof(B)=='undefined')?'getChildContainer':B;var C=(typeof(A['flexy:foreach'])!='undefined');var D=(typeof(A['flexy:if'])!='undefined');var E=Roo.XComponent.build_from_html;var F=(A.xtype=='Body');var G=(Roo.get(document.body).attr('xtype')=='Roo.bootstrap.Body');var H=Roo.get(this[B](false));if(!C||!E||F||!G){if(!D||typeof(A.name)=='undefined'||!E||F||!G){return this.addxtypeChild(A,B);}var I=H?H.child('>*[name='+A.name+']'):false;if(I){return this.addxtypeChild(Roo.apply({},A),B);}
 Roo.log('skipping render');return cn;}var J=false;while(true){var I=H?H.child('>*[xtype]'):false;if(!I){break;}if(I&&I.attr('xtype').split('.').pop()!=cn.xtype){break;}
-J=this.addxtypeChild(Roo.apply({},A),B);}return J;},addxtypeChild:function(A,B){Roo.log('addxtypeChild:'+B);var cn=this;B=(typeof(B)=='undefined')?'getChildContainer':B;var C=(typeof(A['flexy:if'])!='undefined')||(typeof(A['flexy:foreach'])!='undefined');if(A.xtype!='Body'){cn=Roo.factory(A);cn.parentType=this.xtype;cn.parentId=this.id;var D=Roo.XComponent.build_from_html;if(Roo.get(document.body).attr('xtype')=='Roo.bootstrap.Body'){var E=Roo.get(this[B](false));var F=E?E.child('>*[xtype]'):false;if(F&&F.attr('xtype').split('.').pop()==cn.xtype){cn.el=F;}else {Roo.log("MISSING "+cn.xtype+" on child of "+(this.el?this.el.attr('xbuilderid'):'no parent'));}}if(D&&C&&!cn.el&&cn.can_build_overlaid){Roo.log('skipping render');}else {cn.render(this[B](true));}}var G=[];if(!A.items||!A.items.length){cn.items=G;return cn;}var H=A.items;delete A.items;for(var i=0;i<H.length;i++){G.push(cn.addxtype(Roo.apply({},H[i])));}
+J=this.addxtypeChild(Roo.apply({},A),B);}return J;},addxtypeChild:function(A,B){Roo.log('addxtypeChild:'+B);var cn=this;B=(typeof(B)=='undefined')?'getChildContainer':B;var C=(typeof(A['flexy:if'])!='undefined')||(typeof(A['flexy:foreach'])!='undefined');if(A.xtype!='Body'){cn=Roo.factory(A);cn.parentType=this.xtype;cn.parentId=this.id;var D=Roo.XComponent.build_from_html;if(Roo.get(document.body).attr('xtype')=='Roo.bootstrap.Body'){var E=Roo.get(this[B](false));var F=E?E.child('>*[xtype]'):false;if(F&&F.attr('xtype').split('.').pop()==cn.xtype){cn.el=F;}else {Roo.log("MISSING "+cn.xtype+" on child of "+(this.el?this.el.attr('xbuilderid'):'no parent'));}}
+skip_children=false;if(D&&C&&!cn.el&&cn.can_build_overlaid){Roo.log('skipping render');if(!cn.el){skip_children=true;}}else {cn.render(this[B](true));}}var G=[];if(!A.items||!A.items.length){cn.items=G;return cn;}var H=A.items;delete A.items;if(!skip_children){for(var i=0;i<H.length;i++){G.push(cn.addxtype(Roo.apply({},H[i])));}}
 cn.items=G;return cn;}});
 //Roo/bootstrap/Body.js
 Roo.bootstrap.Body=function(A){Roo.bootstrap.Body.superclass.constructor.call(this,A);this.el=Roo.get(document.body);if(this.cls&&this.cls.length){Roo.get(document.body).addClass(this.cls);}};Roo.extend(Roo.bootstrap.Body,Roo.bootstrap.Component,{autoCreate:{cls:'container'},onRender:function(ct,A){}});