roojs-all.js
authorAlan Knowles <alan@akbkhome.com>
Sun, 1 Apr 2012 07:42:36 +0000 (15:42 +0800)
committerAlan Knowles <alan@akbkhome.com>
Sun, 1 Apr 2012 07:42:36 +0000 (15:42 +0800)
roojs-all.js

index c8488ff..8b0a66d 100644 (file)
@@ -1149,7 +1149,7 @@ Roo.extend(Roo.XComponent,Roo.util.Observable,{el:false,panel:false,layout:false
 this.parent=false;el=Roo.get(A);if(!el){Roo.log("Warning - element can not be found :#"+A);return;}}if(!this.parent){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}})}}var B=this._tree?this._tree():this.tree();B.region=B.region||this.region;this.el=this.parent.el.addxtype(B);this.fireEvent('built',this);this.panel=this.el;this.layout=this.panel.layout;}});Roo.apply(Roo.XComponent,{buildCompleted:false,topModule:false,modules:[],elmodules:[],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){var B=A.parent;try{A.parent=this.toObject(B);}catch(e){Roo.log("parent:toObject failed: "+e.toString());return;}if(!A.parent){Roo.log("GOT top level module");Roo.log(A);A.modules=new Roo.util.MixedCollection(false,function(o){return o.order+''});this.topModule=A;return;}if(typeof(A.parent)=='string'){this.elmodules.push(A);return;}if(A.parent.constructor!=Roo.XComponent){Roo.log("Warning : Object Parent is not instance of XComponent:"+A.name)}if(!A.parent.modules){A.parent.modules=new Roo.util.MixedCollection(false,function(o){return o.order+''});}
+o=o[e];});return o;},preBuild:function(){var _t=this;Roo.each(this.modules,function(A){var B=A.parent;try{A.parent=this.toObject(B);}catch(e){Roo.log("parent:toObject failed: "+e.toString());return;}if(!A.parent){Roo.debug&&Roo.log("GOT top level module");Roo.debug&&Roo.log(A);A.modules=new Roo.util.MixedCollection(false,function(o){return o.order+''});this.topModule=A;return;}if(typeof(A.parent)=='string'){this.elmodules.push(A);return;}if(A.parent.constructor!=Roo.XComponent){Roo.log("Warning : Object Parent is not instance of XComponent:"+A.name)}if(!A.parent.modules){A.parent.modules=new Roo.util.MixedCollection(false,function(o){return o.order+''});}
 A.parent.modules.add(A);},this);},buildOrder:function(){var A=this;var B=function(a,b){return String(a).toUpperCase()>String(b).toUpperCase()?1:-1;};if((!this.topModule||!this.topModule.modules)&&!this.elmodules.length){throw "No top level modules to build";}var C=this.topModule?[this.topModule]:[];Roo.each(this.elmodules,function(e){C.push(e)});var D=function(m){Roo.debug&&Roo.log("build Order: add: "+m.name);C.push(m);if(m.modules){Roo.debug&&Roo.log("build Order: "+m.modules.length+" child modules");m.modules.keySort('ASC',B);Roo.debug&&Roo.log("build Order: "+m.modules.length+" child modules (after sort)");m.modules.each(D);}else {Roo.debug&&Roo.log("build Order: no child modules");}if(m.finalize){m.finalize.name=m.name+" (clean up) ";C.push(m.finalize);}};if(this.topModule){this.topModule.modules.keySort('ASC',B);this.topModule.modules.each(D);}return C;},build:function(){this.preBuild();var A=this.buildOrder();if(!A.length){throw "NO modules!!!";}var B="Building Interface...";Roo.MessageBox.show({title:'loading'});Roo.MessageBox.show({title:"Please wait...",msg:B,width:450,progress:true,closable:false,modal:false});var C=A.length;var D=this;var E=function(){if(!A.length){Roo.debug&&Roo.log('hide?');Roo.MessageBox.hide();Roo.XComponent.event.fireEvent('buildcomplete',D.topModule);return false;}var m=A.shift();Roo.debug&&Roo.log(m);if(typeof(m)=='function'){m.call(this);return E.defer(10,D);}B="Building Interface "+(C-A.length)+" of "+C+(m.name?(' - '+m.name):'');Roo.debug&&Roo.log(B);Roo.MessageBox.updateProgress((C-A.length)/C,B);var F=(typeof(m.disabled)=='function')?m.disabled.call(m.module.disabled):m.disabled;if(F){return E();}
 m.render();return E.defer(10,D);}
 E.defer(1,D);},event:false,on:false});Roo.XComponent.event=new Roo.util.Observable({events:{'register':true,'buildcomplete':true}});Roo.XComponent.on=Roo.XComponent.event.on.createDelegate(Roo.XComponent.event);