Roo/Document.js
authorAlan Knowles <alan@akbkhome.com>
Wed, 23 Jun 2010 05:01:55 +0000 (13:01 +0800)
committerAlan Knowles <alan@akbkhome.com>
Wed, 23 Jun 2010 05:01:55 +0000 (13:01 +0800)
Roo/Document.js

index 1628d81..b912e93 100644 (file)
@@ -173,7 +173,8 @@ Roo.extend(Roo.Document, Roo.util.Observable, {
         if (!parent.modules) {
             return;
         }
-        parent.modules.keySort('ASC',  cmp );
+       
+        // make a flat list in order of modules to build.
         var mods = [];
         
         
@@ -192,13 +193,15 @@ Roo.extend(Roo.Document, Roo.util.Observable, {
             }
             
         }
+        parent.modules.keySort('ASC',  cmp );
         parent.modules.each(addMod);
         //this.allmods = mods;
         //console.log(mods);
         //return;
         if (!mods.length) {
-            if (onComplete) onComplete();
+            if (onComplete) {
+                onComplete.call(this);
+            }
             return;
         }
         // flash it up as modal - so we store the mask!?