You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by fi...@apache.org on 2012/07/12 22:31:40 UTC

[2/6] js commit: [CB-1013] Small tweaks to bada implementation.

[CB-1013] Small tweaks to bada implementation.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/commit/738f9d3d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/738f9d3d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/738f9d3d

Branch: refs/heads/master
Commit: 738f9d3dea9a1163ca933784ab0e0117bb3d0461
Parents: d0d687f
Author: Fil Maj <ma...@gmail.com>
Authored: Thu Jul 12 13:29:30 2012 -0700
Committer: Fil Maj <ma...@gmail.com>
Committed: Thu Jul 12 13:29:30 2012 -0700

----------------------------------------------------------------------
 lib/bada/plugin/bada/device.js |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/738f9d3d/lib/bada/plugin/bada/device.js
----------------------------------------------------------------------
diff --git a/lib/bada/plugin/bada/device.js b/lib/bada/plugin/bada/device.js
index 4cebf13..e64e9db 100644
--- a/lib/bada/plugin/bada/device.js
+++ b/lib/bada/plugin/bada/device.js
@@ -1,7 +1,10 @@
-var channel = require('cordova/channel');
+var channel = require('cordova/channel'),
+    utils = require('cordova/utils');
 
-function Device() {
+// Tell cordova channel to wait on the CordovaInfoReady event
+channel.waitForInitialization('onCordovaInfoReady');
 
+function Device() {
     this.platform = null;
     this.version = null;
     this.name = null;
@@ -19,11 +22,10 @@ function Device() {
            me.cordova  = device.cordova;
 
            channel.onCordovaInfoReady.fire();
-           //console.log("CordovaInfoReady "+JSON.stringify(device));
        },
        function (e) {
            me.available = false;
-           console.log("error initializing cordova: " + e);
+           utils.alert("error initializing cordova: " + e);
        });
     });
 }