From dfbfcaabd44b6469047c3590775d420f6aeaf183 Mon Sep 17 00:00:00 2001 From: leon Date: Wed, 22 Mar 2023 13:47:26 +0800 Subject: [PATCH] Roo/bootstrap/Component.js roojs-bootstrap.js roojs-bootstrap-debug.js --- Roo/bootstrap/Component.js | 8 -------- roojs-bootstrap-debug.js | 8 -------- roojs-bootstrap.js | 17 ++++++++--------- 3 files changed, 8 insertions(+), 25 deletions(-) diff --git a/Roo/bootstrap/Component.js b/Roo/bootstrap/Component.js index 3c6e2dabf3..3279787574 100644 --- a/Roo/bootstrap/Component.js +++ b/Roo/bootstrap/Component.js @@ -169,14 +169,11 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent, { { var cn = this; - Roo.log('ADDXTYPE'); cn = Roo.factory(tree); //Roo.log(['addxtype', cn]); cn.parentType = this.xtype; //?? cn.parentId = this.id; - - Roo.log(cn.el); cntr = (typeof(cntr) == 'undefined' ) ? 'getChildContainer' : cntr; if (typeof(cn.container_method) == 'string') { @@ -245,7 +242,6 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent, { addxtypeChild : function (tree, cntr, is_body) { Roo.debug && Roo.log('addxtypeChild:' + cntr); - Roo.log('ADDXTYPECHILD'); var cn = this; cntr = (typeof(cntr) == 'undefined' ) ? 'getChildContainer' : cntr; @@ -266,7 +262,6 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent, { } cn = Roo.factory(tree); - Roo.log(cn.el); cn.parentType = this.xtype; //?? cn.parentId = this.id; @@ -292,15 +287,12 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent, { // at present the only work around for this is to nest flexy:if elements in another element that is always rendered. - Roo.log(echild); - Roo.log(cn); if (echild && echild.attr('xtype').split('.').pop() == cn.xtype) { // Roo.log("found child for " + this.xtype +": " + echild.attr('xtype') ); cn.el = echild; - Roo.log(cn.el); // Roo.log("GOT"); //echild.dom.removeAttribute('xtype'); } else { diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 609c6e0ef8..acd4889e03 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -389,14 +389,11 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent, { { var cn = this; - Roo.log('ADDXTYPE'); cn = Roo.factory(tree); //Roo.log(['addxtype', cn]); cn.parentType = this.xtype; //?? cn.parentId = this.id; - - Roo.log(cn.el); cntr = (typeof(cntr) == 'undefined' ) ? 'getChildContainer' : cntr; if (typeof(cn.container_method) == 'string') { @@ -465,7 +462,6 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent, { addxtypeChild : function (tree, cntr, is_body) { Roo.debug && Roo.log('addxtypeChild:' + cntr); - Roo.log('ADDXTYPECHILD'); var cn = this; cntr = (typeof(cntr) == 'undefined' ) ? 'getChildContainer' : cntr; @@ -486,7 +482,6 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent, { } cn = Roo.factory(tree); - Roo.log(cn.el); cn.parentType = this.xtype; //?? cn.parentId = this.id; @@ -512,15 +507,12 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent, { // at present the only work around for this is to nest flexy:if elements in another element that is always rendered. - Roo.log(echild); - Roo.log(cn); if (echild && echild.attr('xtype').split('.').pop() == cn.xtype) { // Roo.log("found child for " + this.xtype +": " + echild.attr('xtype') ); cn.el = echild; - Roo.log(cn.el); // Roo.log("GOT"); //echild.dom.removeAttribute('xtype'); } else { diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 5fa32a3011..f79404aaaa 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -31,15 +31,14 @@ Roo.bootstrap=Roo.bootstrap||{};Roo.bootstrap.Component=function(A){Roo.bootstra 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=(typeof(B.style)=='undefined'?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;},getDocumentBody:function(){return Roo.get(document.body);},tooltipEl:function(){return this.el;},addxtype:function(A,B){var cn=this; -Roo.log('ADDXTYPE');cn=Roo.factory(A);cn.parentType=this.xtype;cn.parentId=this.id;Roo.log(cn.el);B=(typeof(B)=='undefined')?'getChildContainer':B;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);Roo.log('ADDXTYPECHILD'); -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);Roo.log(cn.el);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){}Roo.log(G);Roo.log(cn);if(G&&G.attr('xtype').split('.').pop()==cn.xtype){cn.el=G; -Roo.log(cn.el);}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*[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;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