roojs-core.js
authorEdward <edward@roojs.com>
Fri, 21 Mar 2014 11:57:19 +0000 (19:57 +0800)
committerEdward <edward@roojs.com>
Fri, 21 Mar 2014 11:57:19 +0000 (19:57 +0800)
roojs-core-debug.js

roojs-core-debug.js
roojs-core.js

index 6dd6faf..a6354b5 100644 (file)
@@ -16156,6 +16156,8 @@ Roo.apply(Roo.XComponent, {
     {
         
         this.preBuild();
+        Roo.log('this.elmodules');
+        Roo.log(this.elmodules);
         var mods = this.buildOrder();
         Roo.log('build mods');
         Roo.log(mods);
index d9268fd..3607b82 100644 (file)
@@ -326,7 +326,7 @@ this.el=this.parent.el.addxtype(B);this.fireEvent('built',this);this.panel=this.
 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.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+''});}if(A.parent.disabled){A.disabled=true;}
-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);if(!this.topModule&&typeof(e.parent)=='string'&&e.parent.substring(0,1)=='#'&&Roo.get(e.parent.substr(1))){A.topModule=e;}});var D=function(m){Roo.debug&&Roo.log("build Order: add: "+m.name);C.push(m);if(m.modules&&!m.disabled){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){this.topModule.modules.keySort('ASC',B);this.topModule.modules.each(D);}return C;},build:function(){this.preBuild();var A=this.buildOrder();Roo.log('build mods');Roo.log(A);if(!A.length){throw "NO modules!!!";}var B="Building Interface...";if(!this.hideProgress&&Roo.MessageBox){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?');if(!this.hideProgress&&Roo.MessageBox){Roo.MessageBox.hide();}
+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);if(!this.topModule&&typeof(e.parent)=='string'&&e.parent.substring(0,1)=='#'&&Roo.get(e.parent.substr(1))){A.topModule=e;}});var D=function(m){Roo.debug&&Roo.log("build Order: add: "+m.name);C.push(m);if(m.modules&&!m.disabled){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){this.topModule.modules.keySort('ASC',B);this.topModule.modules.each(D);}return C;},build:function(){this.preBuild();Roo.log('this.elmodules');Roo.log(this.elmodules);var A=this.buildOrder();Roo.log('build mods');Roo.log(A);if(!A.length){throw "NO modules!!!";}var B="Building Interface...";if(!this.hideProgress&&Roo.MessageBox){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?');if(!this.hideProgress&&Roo.MessageBox){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);if(!this.hideProgress&&Roo.MessageBox){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,'beforebuild':true,'buildcomplete':true}});Roo.XComponent.on=Roo.XComponent.event.on.createDelegate(Roo.XComponent.event);