From a4b25dfbed396c51019164918a1127d2a1091ee2 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Wed, 23 Jun 2010 13:40:17 +0800 Subject: [PATCH] Roo/Document.js --- Roo/Document.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Roo/Document.js b/Roo/Document.js index 4c6493d207..ddc1f348ba 100644 --- a/Roo/Document.js +++ b/Roo/Document.js @@ -104,8 +104,7 @@ Roo.apply(Roo.XComponent, */ register : function(obj) { this.modules.push(obj); - - + }, /** * convert a string to an object.. @@ -172,6 +171,8 @@ Roo.apply(Roo.XComponent, build : function(onCompleteFn) { + + var onComplete = function () { if (onCompleteFn) { onCompleteFn.call(this); @@ -214,8 +215,8 @@ Roo.apply(Roo.XComponent, //this.allmods = mods; //console.log(mods); //return; - if (!mods.length) { - return onComplete.call(this); + if (!mods.length) { // should not happen + throw "NO modules!!!"; } // flash it up as modal - so we store the mask!? Roo.MessageBox.show({ title: 'loading' }); @@ -233,7 +234,8 @@ Roo.apply(Roo.XComponent, var progressRun = function() { n++; if (n >= mods.length) { - return onComplete.call(this); + _this.topModule.fireEvent('built', _this.topModule); + return; } var m = mods[n]; -- 2.39.2