Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5E63E11EA0 for ; Thu, 27 Mar 2014 14:22:33 +0000 (UTC) Received: (qmail 10626 invoked by uid 500); 27 Mar 2014 14:22:33 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 10598 invoked by uid 500); 27 Mar 2014 14:22:31 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 9469 invoked by uid 99); 27 Mar 2014 14:22:12 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Mar 2014 14:22:12 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 32282837E96; Thu, 27 Mar 2014 14:22:11 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: anis@apache.org To: commits@cordova.apache.org Date: Thu, 27 Mar 2014 14:22:18 -0000 Message-Id: <4fade55dc01c45478fa392c62586141f@git.apache.org> In-Reply-To: <05fc672c685b49e1ab868e7427456c94@git.apache.org> References: <05fc672c685b49e1ab868e7427456c94@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [09/34] js commit: CB-5671 setTimeout to allow concat'ed JS to load before pluginLoader.load() CB-5671 setTimeout to allow concat'ed JS to load before pluginLoader.load() Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/2c375dd4 Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/2c375dd4 Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/2c375dd4 Branch: refs/heads/browserify Commit: 2c375dd4f585b3fb29ff67ec455918c3a333fc7a Parents: 5f811bb Author: Andrew Grieve Authored: Mon Feb 24 21:04:02 2014 -0500 Committer: Andrew Grieve Committed: Mon Feb 24 21:04:02 2014 -0500 ---------------------------------------------------------------------- src/common/init.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-js/blob/2c375dd4/src/common/init.js ---------------------------------------------------------------------- diff --git a/src/common/init.js b/src/common/init.js index 65c6380..4f4882c 100644 --- a/src/common/init.js +++ b/src/common/init.js @@ -103,9 +103,13 @@ modulemapper.clobbers('cordova/exec', 'Cordova.exec'); // Call the platform-specific initialization. platform.bootstrap && platform.bootstrap(); -pluginloader.load(function() { - channel.onPluginsReady.fire(); -}); +// Wrap in a setTimeout to support the use-case of having plugin JS appended to cordova.js. +// The delay allows the attached modules to be defined before the plugin loader looks for them. +setTimeout(function() { + pluginloader.load(function() { + channel.onPluginsReady.fire(); + }); +}, 0); /** * Create all cordova objects once native side is ready.