From: Alan Knowles Date: Thu, 21 Feb 2019 08:58:22 +0000 (+0800) Subject: roojs-bootstrap.js X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=0d85b0ed9cd27cb5e8545ec17fab846c13e40a80 roojs-bootstrap.js roojs-bootstrap-debug.js roojs-calendar.js roojs-calendar-debug.js Roo/bootstrap/Component.js --- diff --git a/Roo/bootstrap/Component.js b/Roo/bootstrap/Component.js index 30ee2ac9e4..b5789bd880 100644 --- a/Roo/bootstrap/Component.js +++ b/Roo/bootstrap/Component.js @@ -196,7 +196,8 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent, { if (!has_flexy_each || !build_from_html || is_body || !page_has_body) { if(!has_flexy_if || typeof(tree.name) == 'undefined' || !build_from_html || is_body || !page_has_body){ - return this.addxtypeChild(tree,cntr, is_body); + //return this.addxtypeChild(tree,cntr, is_body); + return this.addxtypeChild(cn, cntr, is_body); } var echild =self_cntr_el ? self_cntr_el.child('>*[name=' + tree.name + ']') : false; diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index f058144e15..946185e69d 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -181,13 +181,11 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent, { */ addxtype : function(tree,cntr) { - var cn = Roo.factory(tree); - //Roo.log(['addxtype', cn]); - + cntr = (typeof(cntr) == 'undefined' ) ? 'getChildContainer' : cntr; + + var cn = Roo.factory(tree); // this is posibly the first of two times that the ctor get's called... cn.parentType = this.xtype; //?? cn.parentId = this.id; - - cntr = (typeof(cntr) == 'undefined' ) ? 'getChildContainer' : cntr; if (typeof(cn.container_method) == 'string') { cntr = cn.container_method; } diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index ca50904022..08dfbcc8d4 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -5,7 +5,7 @@ Roo.bootstrap=Roo.bootstrap||{};Roo.bootstrap.Component=function(A){Roo.bootstra ,xattr:false,parentId:false,can_build_overlaid:true,container_method:false,dataId:false,name:false,parent:function(){return Roo.ComponentMgr.get(this.parentId)},onRender:function(ct,A){Roo.bootstrap.Component.superclass.onRender.call(this,ct,A);if(this.el){if(this.el.attr('xtype')){this.el.attr('xtypex',this.el.attr('xtype')); this.el.dom.removeAttribute('xtype');this.initEvents();}return;}var B=Roo.apply({},this.getAutoCreate());B.id=this.id||Roo.id();if(this.xattr&&typeof(this.xattr)=='object'){for(var i in this.xattr){B[i]=this.xattr[i];}}if(this.dataId){B.dataId=this.dataId; }if(this.cls){B.cls=(typeof(B.cls)=='undefined')?this.cls:B.cls+' '+this.cls;}if(this.style){B.style=this.style;}if(this.name){B.name=this.name;}this.el=ct.createChild(B,A);if(this.tooltip){this.tooltipEl().attr('tooltip',this.tooltip);}if(this.tabIndex!==undefined){this.el.dom.setAttribute('tabIndex',this.tabIndex); -}this.initEvents();},getChildContainer:function(){return this.el;},tooltipEl:function(){return this.el;},addxtype:function(A,B){var cn=Roo.factory(A);cn.parentType=this.xtype;cn.parentId=this.id;B=(typeof(B)=='undefined')?'getChildContainer':B;if(typeof(cn.container_method)=='string'){B=cn.container_method; +}this.initEvents();},getChildContainer:function(){return this.el;},tooltipEl:function(){return this.el;},addxtype:function(A,B){B=(typeof(B)=='undefined')?'getChildContainer':B;var cn=Roo.factory(A);cn.parentType=this.xtype;cn.parentId=this.id;if(typeof(cn.container_method)=='string'){B=cn.container_method; }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||D||this.can_build_overlaid==false)&&E){return false; }if(!C||!E||F||!G){if(!D||typeof(A.name)=='undefined'||!E||F||!G){return this.addxtypeChild(A,B,F);}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;if(!E){return 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,C){Roo.debug&&Roo.log('addxtypeChild:'+B);var cn=this;B=(typeof(B)=='undefined')?'getChildContainer':B; diff --git a/roojs-calendar-debug.js b/roojs-calendar-debug.js index 87a4df514f..80b89125a2 100644 --- a/roojs-calendar-debug.js +++ b/roojs-calendar-debug.js @@ -167,13 +167,11 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent, { */ addxtype : function(tree,cntr) { - var cn = Roo.factory(tree); - //Roo.log(['addxtype', cn]); - + cntr = (typeof(cntr) == 'undefined' ) ? 'getChildContainer' : cntr; + + var cn = Roo.factory(tree); // this is posibly the first of two times that the ctor get's called... cn.parentType = this.xtype; //?? cn.parentId = this.id; - - cntr = (typeof(cntr) == 'undefined' ) ? 'getChildContainer' : cntr; if (typeof(cn.container_method) == 'string') { cntr = cn.container_method; } diff --git a/roojs-calendar.js b/roojs-calendar.js index 370a4a164c..77bb989238 100644 --- a/roojs-calendar.js +++ b/roojs-calendar.js @@ -3,7 +3,7 @@ Roo.bootstrap=Roo.bootstrap||{};Roo.bootstrap.Component=function(A){Roo.bootstra ,xattr:false,parentId:false,can_build_overlaid:true,container_method:false,dataId:false,name:false,parent:function(){return Roo.ComponentMgr.get(this.parentId)},onRender:function(ct,A){Roo.bootstrap.Component.superclass.onRender.call(this,ct,A);if(this.el){if(this.el.attr('xtype')){this.el.attr('xtypex',this.el.attr('xtype')); this.el.dom.removeAttribute('xtype');this.initEvents();}return;}var B=Roo.apply({},this.getAutoCreate());B.id=this.id||Roo.id();if(this.xattr&&typeof(this.xattr)=='object'){for(var i in this.xattr){B[i]=this.xattr[i];}}if(this.dataId){B.dataId=this.dataId; }if(this.cls){B.cls=(typeof(B.cls)=='undefined')?this.cls:B.cls+' '+this.cls;}if(this.style){B.style=this.style;}if(this.name){B.name=this.name;}this.el=ct.createChild(B,A);if(this.tooltip){this.tooltipEl().attr('tooltip',this.tooltip);}if(this.tabIndex!==undefined){this.el.dom.setAttribute('tabIndex',this.tabIndex); -}this.initEvents();},getChildContainer:function(){return this.el;},tooltipEl:function(){return this.el;},addxtype:function(A,B){var cn=Roo.factory(A);cn.parentType=this.xtype;cn.parentId=this.id;B=(typeof(B)=='undefined')?'getChildContainer':B;if(typeof(cn.container_method)=='string'){B=cn.container_method; +}this.initEvents();},getChildContainer:function(){return this.el;},tooltipEl:function(){return this.el;},addxtype:function(A,B){B=(typeof(B)=='undefined')?'getChildContainer':B;var cn=Roo.factory(A);cn.parentType=this.xtype;cn.parentId=this.id;if(typeof(cn.container_method)=='string'){B=cn.container_method; }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||D||this.can_build_overlaid==false)&&E){return false; }if(!C||!E||F||!G){if(!D||typeof(A.name)=='undefined'||!E||F||!G){return this.addxtypeChild(A,B,F);}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;if(!E){return 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,C){Roo.debug&&Roo.log('addxtypeChild:'+B);var cn=this;B=(typeof(B)=='undefined')?'getChildContainer':B;