From b079a243730f044cdad2ff92bdd13eebf81c3ee0 Mon Sep 17 00:00:00 2001 From: Bryce Curtis Date: Mon, 20 Sep 2010 15:48:37 -0500 Subject: [PATCH] Need to listen for XHR callbacks before constructors are run, since constructors could call native code that returns data in callback. --- framework/assets/js/phonegap.js.base | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/framework/assets/js/phonegap.js.base b/framework/assets/js/phonegap.js.base index ff503b01..41a7064a 100755 --- a/framework/assets/js/phonegap.js.base +++ b/framework/assets/js/phonegap.js.base @@ -223,18 +223,15 @@ if (typeof _nativeReady !== 'undefined') { PhoneGap.onNativeReady.fire(); } */ PhoneGap.onDeviceReady = new PhoneGap.Channel('onDeviceReady'); -/** - * Start listening for XHR callbacks onDeviceReady - */ -PhoneGap.onDeviceReady.subscribeOnce(function() { - PhoneGap.JSCallback(); -}); /** * Create all PhoneGap objects once page has fully loaded and native side is ready. */ PhoneGap.Channel.join(function() { + // Start listening for XHR callbacks + PhoneGap.JSCallback(); + // Run PhoneGap constructors PhoneGap.onPhoneGapInit.fire();