roojs-bootstrap.js
authorAlan Knowles <alan@roojs.com>
Thu, 21 Feb 2019 07:35:09 +0000 (15:35 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 21 Feb 2019 07:35:09 +0000 (15:35 +0800)
roojs-bootstrap-debug.js
roojs-calendar.js
roojs-calendar-debug.js

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

index 1320956..a14e8ea 100644 (file)
@@ -354,43 +354,12 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent,  {
              }
             // then add the element..
         }
-         
-        // handle the kids..
         
-        var nitems = [];
-        /*
-        if (typeof (tree.menu) != 'undefined') {
-            tree.menu.parentType = cn.xtype;
-            tree.menu.triggerEl = cn.el;
-            nitems.push(cn.addxtype(Roo.apply({}, tree.menu)));
-            
-        }
-        */
-        if (!tree.items || !tree.items.length) {
-            cn.items = nitems;
-            //Roo.log(["no children", this]);
-            
-            return cn;
-        }
-         
-        var items = tree.items;
+       
+       var items = tree.items;
         delete tree.items;
         
-        //Roo.log(items.length);
-            // add the items..
-        if (!skip_children) {    
-            for(var i =0;i < items.length;i++) {
-              //  Roo.log(['add child', items[i]]);
-                nitems.push(cn.addxtype(Roo.apply({}, items[i])));
-            }
-        }
-        
-        cn.items = nitems;
-        
-        //Roo.log("fire childrenrendered");
-        
-        cn.fireEvent('childrenrendered', this);
-        
+       cn.addxtypeChildren(items);
         return cn;
     },
     
index 0f54658..e5208be 100644 (file)
@@ -11,11 +11,11 @@ this.el.dom.removeAttribute('xtype');this.initEvents();}return;}var B=Roo.apply(
 }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,C){Roo.debug&&Roo.log('addxtypeChild:'+B);var cn=this;B=(typeof(B)=='undefined')?'getChildContainer':B;
 var D=(typeof(A['flexy:if'])!='undefined')||(typeof(A['flexy:foreach'])!='undefined');skip_children=false;if(!C){if(!this[B](true)){A.items=[];return A;}cn=Roo.factory(A);cn.parentType=this.xtype;cn.parentId=this.id;var E=Roo.XComponent.build_from_html;if(E&&Roo.get(document.body).attr('xtype')=='Roo.bootstrap.Body'){var F=Roo.get(this[B](false));
 var G=F?F.child('>*[xtype]'):false;if(G){}if(G&&G.attr('xtype').split('.').pop()==cn.xtype){cn.el=G;}else{Roo.debug&&Roo.log("MISSING "+cn.xtype+" on child of "+(this.el?this.el.attr('xbuilderid'):'no parent'));Roo.debug&&Roo.log(F);Roo.debug&&Roo.log(G);
-Roo.debug&&Roo.log(cn);}}if(E&&D&&!cn.el&&cn.can_build_overlaid){Roo.debug&&Roo.log('skipping render');Roo.debug&&Roo.log(A);if(!cn.el){Roo.debug&&Roo.log('skipping all children');skip_children=true;}}else{cn.render&&cn.render(this[B](true));}}var H=[];if(!A.items||!A.items.length){cn.items=H;
-return cn;}var I=A.items;delete A.items;if(!skip_children){for(var i=0;i<I.length;i++){H.push(cn.addxtype(Roo.apply({},I[i])));}}cn.items=H;cn.fireEvent('childrenrendered',this);return cn;},addxtypeChildren:function(A,B){var C=[];if(!A||!A.length){this.items=C;
-return;}for(var i=0;i<A.length;i++){if(B){break;}C.push(this.addxtype(Roo.apply({},A[i])));}this.items=C;this.fireEvent('childrenrendered',this);},setVisibilityEl:function(el){this.visibilityEl=el;},getVisibilityEl:function(){if(typeof(this.visibilityEl)=='object'){return this.visibilityEl;
-}if(typeof(this.visibilityEl)=='string'){return this.visibilityEl=='parent'?this.parent().getEl():this.getEl();}return this.getEl();},show:function(){if(!this.getVisibilityEl()){return;}this.getVisibilityEl().removeClass(['hidden','d-none']);this.fireEvent('show',this);
-},hide:function(){if(!this.getVisibilityEl()){return;}this.getVisibilityEl().addClass(['hidden','d-none']);this.fireEvent('hide',this);}});
+Roo.debug&&Roo.log(cn);}}if(E&&D&&!cn.el&&cn.can_build_overlaid){Roo.debug&&Roo.log('skipping render');Roo.debug&&Roo.log(A);if(!cn.el){Roo.debug&&Roo.log('skipping all children');skip_children=true;}}else{cn.render&&cn.render(this[B](true));}}var H=A.items;
+delete A.items;cn.addxtypeChildren(H);return cn;},addxtypeChildren:function(A,B){var C=[];if(!A||!A.length){this.items=C;return;}for(var i=0;i<A.length;i++){if(B){break;}C.push(this.addxtype(Roo.apply({},A[i])));}this.items=C;this.fireEvent('childrenrendered',this);
+},setVisibilityEl:function(el){this.visibilityEl=el;},getVisibilityEl:function(){if(typeof(this.visibilityEl)=='object'){return this.visibilityEl;}if(typeof(this.visibilityEl)=='string'){return this.visibilityEl=='parent'?this.parent().getEl():this.getEl();
+}return this.getEl();},show:function(){if(!this.getVisibilityEl()){return;}this.getVisibilityEl().removeClass(['hidden','d-none']);this.fireEvent('show',this);},hide:function(){if(!this.getVisibilityEl()){return;}this.getVisibilityEl().addClass(['hidden','d-none']);
+this.fireEvent('hide',this);}});
 // Roo/bootstrap/Body.js
 Roo.bootstrap.Body=function(A){A=A||{};Roo.bootstrap.Body.superclass.constructor.call(this,A);this.el=Roo.get(A.el?A.el:document.body);if(this.cls&&this.cls.length){Roo.get(document.body).addClass(this.cls);}};Roo.extend(Roo.bootstrap.Body,Roo.bootstrap.Component,{is_body:true,autoCreate:{cls:'container'}
 ,onRender:function(ct,A){}});
index 3873880..552b140 100644 (file)
@@ -340,43 +340,12 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent,  {
              }
             // then add the element..
         }
-         
-        // handle the kids..
         
-        var nitems = [];
-        /*
-        if (typeof (tree.menu) != 'undefined') {
-            tree.menu.parentType = cn.xtype;
-            tree.menu.triggerEl = cn.el;
-            nitems.push(cn.addxtype(Roo.apply({}, tree.menu)));
-            
-        }
-        */
-        if (!tree.items || !tree.items.length) {
-            cn.items = nitems;
-            //Roo.log(["no children", this]);
-            
-            return cn;
-        }
-         
-        var items = tree.items;
+       
+       var items = tree.items;
         delete tree.items;
         
-        //Roo.log(items.length);
-            // add the items..
-        if (!skip_children) {    
-            for(var i =0;i < items.length;i++) {
-              //  Roo.log(['add child', items[i]]);
-                nitems.push(cn.addxtype(Roo.apply({}, items[i])));
-            }
-        }
-        
-        cn.items = nitems;
-        
-        //Roo.log("fire childrenrendered");
-        
-        cn.fireEvent('childrenrendered', this);
-        
+       cn.addxtypeChildren(items);
         return cn;
     },
     
index c9ab0c5..e78d426 100644 (file)
@@ -9,11 +9,11 @@ this.el.dom.removeAttribute('xtype');this.initEvents();}return;}var B=Roo.apply(
 }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,C){Roo.debug&&Roo.log('addxtypeChild:'+B);var cn=this;B=(typeof(B)=='undefined')?'getChildContainer':B;
 var D=(typeof(A['flexy:if'])!='undefined')||(typeof(A['flexy:foreach'])!='undefined');skip_children=false;if(!C){if(!this[B](true)){A.items=[];return A;}cn=Roo.factory(A);cn.parentType=this.xtype;cn.parentId=this.id;var E=Roo.XComponent.build_from_html;if(E&&Roo.get(document.body).attr('xtype')=='Roo.bootstrap.Body'){var F=Roo.get(this[B](false));
 var G=F?F.child('>*[xtype]'):false;if(G){}if(G&&G.attr('xtype').split('.').pop()==cn.xtype){cn.el=G;}else{Roo.debug&&Roo.log("MISSING "+cn.xtype+" on child of "+(this.el?this.el.attr('xbuilderid'):'no parent'));Roo.debug&&Roo.log(F);Roo.debug&&Roo.log(G);
-Roo.debug&&Roo.log(cn);}}if(E&&D&&!cn.el&&cn.can_build_overlaid){Roo.debug&&Roo.log('skipping render');Roo.debug&&Roo.log(A);if(!cn.el){Roo.debug&&Roo.log('skipping all children');skip_children=true;}}else{cn.render&&cn.render(this[B](true));}}var H=[];if(!A.items||!A.items.length){cn.items=H;
-return cn;}var I=A.items;delete A.items;if(!skip_children){for(var i=0;i<I.length;i++){H.push(cn.addxtype(Roo.apply({},I[i])));}}cn.items=H;cn.fireEvent('childrenrendered',this);return cn;},addxtypeChildren:function(A,B){var C=[];if(!A||!A.length){this.items=C;
-return;}for(var i=0;i<A.length;i++){if(B){break;}C.push(this.addxtype(Roo.apply({},A[i])));}this.items=C;this.fireEvent('childrenrendered',this);},setVisibilityEl:function(el){this.visibilityEl=el;},getVisibilityEl:function(){if(typeof(this.visibilityEl)=='object'){return this.visibilityEl;
-}if(typeof(this.visibilityEl)=='string'){return this.visibilityEl=='parent'?this.parent().getEl():this.getEl();}return this.getEl();},show:function(){if(!this.getVisibilityEl()){return;}this.getVisibilityEl().removeClass(['hidden','d-none']);this.fireEvent('show',this);
-},hide:function(){if(!this.getVisibilityEl()){return;}this.getVisibilityEl().addClass(['hidden','d-none']);this.fireEvent('hide',this);}});
+Roo.debug&&Roo.log(cn);}}if(E&&D&&!cn.el&&cn.can_build_overlaid){Roo.debug&&Roo.log('skipping render');Roo.debug&&Roo.log(A);if(!cn.el){Roo.debug&&Roo.log('skipping all children');skip_children=true;}}else{cn.render&&cn.render(this[B](true));}}var H=A.items;
+delete A.items;cn.addxtypeChildren(H);return cn;},addxtypeChildren:function(A,B){var C=[];if(!A||!A.length){this.items=C;return;}for(var i=0;i<A.length;i++){if(B){break;}C.push(this.addxtype(Roo.apply({},A[i])));}this.items=C;this.fireEvent('childrenrendered',this);
+},setVisibilityEl:function(el){this.visibilityEl=el;},getVisibilityEl:function(){if(typeof(this.visibilityEl)=='object'){return this.visibilityEl;}if(typeof(this.visibilityEl)=='string'){return this.visibilityEl=='parent'?this.parent().getEl():this.getEl();
+}return this.getEl();},show:function(){if(!this.getVisibilityEl()){return;}this.getVisibilityEl().removeClass(['hidden','d-none']);this.fireEvent('show',this);},hide:function(){if(!this.getVisibilityEl()){return;}this.getVisibilityEl().addClass(['hidden','d-none']);
+this.fireEvent('hide',this);}});
 // Roo/bootstrap/Calendar.js
 Roo.bootstrap=Roo.bootstrap||{};Roo.bootstrap.Calendar=function(A){Roo.bootstrap.Calendar.superclass.constructor.call(this,A);this.addEvents({'select':true,'monthchange':true,'evententer':true,'eventleave':true,'eventclick':true});};Roo.extend(Roo.bootstrap.Calendar,Roo.bootstrap.Component,{startDay:0,loadMask:false,header:false,getAutoCreate:function(){var A=function(H,I,J,K){return Roo.apply({}
 ,{tag:'span',cls:'fc-button fc-button-'+H+' fc-state-default '+(I.length?'fc-corner-'+I.split(' ').join(' fc-corner-'):''),html:'<SPAN class="fc-text-'+J+'">'+K+'</SPAN>',unselectable:'on'});};var B={};if(!this.header){B={tag:'table',cls:'fc-header',style:'width:100%',cn:[{tag:'tr',cn:[{tag:'td',cls:'fc-header-left',cn:[A('prev','left','arrow','&#8249;'),A('next','right','arrow','&#8250;'),{tag:'span',cls:'fc-header-space'}