From 210e1cd0dbb8f7eae9049c25aff22c7c07d9822c Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Tue, 29 Aug 2017 13:23:14 +0800 Subject: [PATCH] roojs-core.js roojs-core-debug.js --- roojs-core-debug.js | 54 +++++++++++++++++++++++++++++++-------------- roojs-core.js | 6 ++--- 2 files changed, 40 insertions(+), 20 deletions(-) diff --git a/roojs-core-debug.js b/roojs-core-debug.js index b85fec1190..260a0db10b 100644 --- a/roojs-core-debug.js +++ b/roojs-core-debug.js @@ -16096,6 +16096,7 @@ Roo.extend(Roo.XComponent, Roo.util.Observable, { return; } } + Roo.debug && Roo.log("EL:"); Roo.debug && Roo.log(el); Roo.debug && Roo.log("this.parent.el:"); @@ -16122,24 +16123,43 @@ Roo.extend(Roo.XComponent, Roo.util.Observable, { Roo.debug && Roo.log("no parent - creating one"); el = el ? Roo.get(el) : false; - - // it's a top level one.. - this.parent = { - el : new Roo.BorderLayout(el || document.body, { - - center: { - titlebar: false, - autoScroll:false, - closeOnTab: true, - tabPosition: 'top', - //resizeTabs: true, - alwaysShowTabs: el && hp? false : true, - hideTabs: el || !hp ? true : false, - minTabWidth: 140 - } - }) - }; + if (typeof(Roo.BorderLayout) == 'undefined' ) { + this.parent = { + el : new Roo.bootstrap.layout.border({ + el: el || document.body, + + center: { + titlebar: false, + autoScroll:false, + closeOnTab: true, + tabPosition: 'top', + //resizeTabs: true, + alwaysShowTabs: el && hp? false : true, + hideTabs: el || !hp ? true : false, + minTabWidth: 140 + } + }) + }; + } else { + + // it's a top level one.. + this.parent = { + el : new Roo.BorderLayout(el || document.body, { + + center: { + titlebar: false, + autoScroll:false, + closeOnTab: true, + tabPosition: 'top', + //resizeTabs: true, + alwaysShowTabs: el && hp? false : true, + hideTabs: el || !hp ? true : false, + minTabWidth: 140 + } + }) + }; + } } if (!this.parent.el) { diff --git a/roojs-core.js b/roojs-core.js index b8bb1aa7f2..1c115a7da9 100644 --- a/roojs-core.js +++ b/roojs-core.js @@ -655,9 +655,9 @@ var hp=this.parent?1:0;Roo.debug&&Roo.log(this);var A=this._tree?this._tree():th ;break;}if(["Nest","Content","Grid","Tree"].indexOf(A.xtype)>-1){this.parent={el:new Roo.bootstrap.layout.Border({el:document.body,center:{titlebar:false,autoScroll:false,closeOnTab:true,tabPosition:'top',alwaysShowTabs:true,hideTabs:false}})};break;}if(typeof(Roo.bootstrap.Body)!='undefined'){this.parent={el:new Roo.bootstrap.Body()} ;Roo.debug&&Roo.log("setting el to doc body");}else{throw "Container is bootstrap body, but Roo.bootstrap.Body is not defined";}break;case 'bootstrap':this.parent={el:true};default:el=Roo.get(B);break;}if(!el&&!this.parent){Roo.debug&&Roo.log("Warning - element can not be found :#"+B); return;}}Roo.debug&&Roo.log("EL:");Roo.debug&&Roo.log(el);Roo.debug&&Roo.log("this.parent.el:");Roo.debug&&Roo.log(this.parent.el);var C=Roo.XComponent.is_alt||(typeof(A.el)!='undefined'&&A.el==document.body)||(typeof(Roo.bootstrap)!='undefined'&&A.xns==Roo.bootstrap)||(typeof(Roo.mailer)!='undefined'&&A.xns==Roo.mailer); -if(!this.parent&&C){this.parent={el:true};}if(!this.parent){Roo.debug&&Roo.log("no parent - creating one");el=el?Roo.get(el):false;this.parent={el:new Roo.BorderLayout(el||document.body,{center:{titlebar:false,autoScroll:false,closeOnTab:true,tabPosition:'top',alwaysShowTabs:el&&hp?false:true,hideTabs:el||!hp?true:false,minTabWidth:140} -})};}if(!this.parent.el){return;}A.region=A.region||this.region;var D=false;if(this.parent.el===true){this.parent.el=Roo.factory(A);D=true;}this.el=this.parent.el.addxtype(A,undefined,D);this.fireEvent('built',this);this.panel=this.el;this.layout=this.panel.layout; -this.parentLayout=this.parent.layout||false;}});Roo.apply(Roo.XComponent,{hideProgress:false,buildCompleted:false,topModule:false,modules:[],elmodules:[],is_alt:false,build_from_html:false,register:function(A){Roo.XComponent.event.fireEvent('register',A); +if(!this.parent&&C){this.parent={el:true};}if(!this.parent){Roo.debug&&Roo.log("no parent - creating one");el=el?Roo.get(el):false;if(typeof(Roo.BorderLayout)=='undefined'){this.parent={el:new Roo.bootstrap.layout.border({el:el||document.body,center:{titlebar:false,autoScroll:false,closeOnTab:true,tabPosition:'top',alwaysShowTabs:el&&hp?false:true,hideTabs:el||!hp?true:false,minTabWidth:140} +})};}else{this.parent={el:new Roo.BorderLayout(el||document.body,{center:{titlebar:false,autoScroll:false,closeOnTab:true,tabPosition:'top',alwaysShowTabs:el&&hp?false:true,hideTabs:el||!hp?true:false,minTabWidth:140}})};}}if(!this.parent.el){return;}A.region=A.region||this.region; +var D=false;if(this.parent.el===true){this.parent.el=Roo.factory(A);D=true;}this.el=this.parent.el.addxtype(A,undefined,D);this.fireEvent('built',this);this.panel=this.el;this.layout=this.panel.layout;this.parentLayout=this.parent.layout||false;}});Roo.apply(Roo.XComponent,{hideProgress:false,buildCompleted:false,topModule:false,modules:[],elmodules:[],is_alt:false,build_from_html:false,register:function(A){Roo.XComponent.event.fireEvent('register',A); switch(typeof(A.disabled)){case 'undefined':break;case 'function':if(A.disabled()){return;}break;default:if(A.disabled){return;}break;}this.modules.push(A);},toObject:function(str){if(!str||typeof(str)=='object'){return str;}if(str.substring(0,1)=='#'){return str; }var ar=str.split('.');var rt,o;rt=ar.shift();try{eval('if (typeof '+rt+' == "undefined"){ o = false;} o = '+rt+';');}catch(e){throw "Module not found : "+str;}if(o===false){throw "Module not found : "+str;}Roo.each(ar,function(e){if(typeof(o[e])=='undefined'){throw "Module not found : "+str; }o=o[e];});return o;},preBuild:function(){var _t=this;Roo.each(this.modules,function(A){Roo.XComponent.event.fireEvent('beforebuild',A);var B=A.parent;try{A.parent=this.toObject(B);}catch(e){Roo.debug&&Roo.log("parent:toObject failed: "+e.toString());return; -- 2.39.2