roojs-bootstrap.js
authorAlan Knowles <alan@roojs.com>
Thu, 21 Feb 2019 09:01:20 +0000 (17:01 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 21 Feb 2019 09:01:20 +0000 (17:01 +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 be37d8e..a98bd3c 100644 (file)
@@ -388,6 +388,30 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent,  {
     },
     
     
+    /**
+     * xAddChildren - the 'sub-compentized' version of the above idea..
+     */
+    xAddChildren: function(child_array, skip_children)
+    {
+       var nitems = [];
+       if (!child_array || !child_array.length ) {
+            this.items = nitems;
+            return;
+        }
+       
+       for(var i =0;i < child_array.length;i++) {
+           if (skip_children) {
+               break;
+           }
+           //  Roo.log(['add child', items[i]]);
+           nitems.push(this.xAdd(Roo.apply({}, child_array[i])));
+       }
+       this.items = nitems;
+        
+        this.fireEvent('childrenrendered', this);
+         
+    },
+    
     
     /**
      * Set the element that will be used to show or hide
index 7e1f4f3..a01b766 100644 (file)
@@ -12,9 +12,10 @@ this.el.dom.removeAttribute('xtype');this.initEvents();}return;}var B=Roo.apply(
 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));}}cn.addxtypeChildren(A.items,skip_children);
-delete A.items;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);}});
+delete A.items;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);},xAddChildren: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.xAdd(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);}if(A.do_render){this.onRender(A.do_render,'');this.xAddChildren(A.items);
 }};Roo.extend(Roo.bootstrap.Body,Roo.bootstrap.Component,{do_render:false,is_body:true,autoCreate:{cls:'container'},onRender:function(ct,A){if(!this.do_render){return;}this.el=Roo.get(this.do_render);}});
index 99dbf62..b7a7e0a 100644 (file)
@@ -374,6 +374,30 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent,  {
     },
     
     
+    /**
+     * xAddChildren - the 'sub-compentized' version of the above idea..
+     */
+    xAddChildren: function(child_array, skip_children)
+    {
+       var nitems = [];
+       if (!child_array || !child_array.length ) {
+            this.items = nitems;
+            return;
+        }
+       
+       for(var i =0;i < child_array.length;i++) {
+           if (skip_children) {
+               break;
+           }
+           //  Roo.log(['add child', items[i]]);
+           nitems.push(this.xAdd(Roo.apply({}, child_array[i])));
+       }
+       this.items = nitems;
+        
+        this.fireEvent('childrenrendered', this);
+         
+    },
+    
     
     /**
      * Set the element that will be used to show or hide
index 77bb989..7f9e0b5 100644 (file)
@@ -10,9 +10,10 @@ this.el.dom.removeAttribute('xtype');this.initEvents();}return;}var B=Roo.apply(
 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));}}cn.addxtypeChildren(A.items,skip_children);
-delete A.items;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);}});
+delete A.items;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);},xAddChildren: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.xAdd(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'}