cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhigg...@apache.org
Subject webworks commit: CB-5815 cordova not defined when pausing w/o cordova.js included
Date Fri, 17 Jan 2014 18:56:39 GMT
Updated Branches:
  refs/heads/master fb7d09582 -> 73d3c307e


CB-5815 cordova not defined when pausing w/o cordova.js included

Don't call cordova.fireDocumentEvent for pause/resume events
unless cordova object is available

BB10 inactive/active events are mapped to Cordova events,
but they shouldn't trigger an exception if cordova.js isn't included


Project: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/commit/73d3c307
Tree: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/tree/73d3c307
Diff: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/diff/73d3c307

Branch: refs/heads/master
Commit: 73d3c307e988abad41fd15fe1696cc388120d290
Parents: fb7d095
Author: Josh Soref <jsoref@blackberry.com>
Authored: Fri Jan 17 13:12:31 2014 -0500
Committer: Josh Soref <jsoref@blackberry.com>
Committed: Fri Jan 17 13:51:51 2014 -0500

----------------------------------------------------------------------
 blackberry10/framework/lib/framework.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/73d3c307/blackberry10/framework/lib/framework.js
----------------------------------------------------------------------
diff --git a/blackberry10/framework/lib/framework.js b/blackberry10/framework/lib/framework.js
index 5b45d1b..c661c14 100644
--- a/blackberry10/framework/lib/framework.js
+++ b/blackberry10/framework/lib/framework.js
@@ -24,13 +24,13 @@ var utils = require('./utils'),
         pause: {
             event: "inactive",
             trigger: function () {
-                webview.executeJavascript("cordova.fireDocumentEvent('pause')");
+                webview.executeJavascript("if (cordova) cordova.fireDocumentEvent('pause')");
             }
         },
         resume: {
             event: "active",
             trigger: function () {
-                webview.executeJavascript("cordova.fireDocumentEvent('resume')");
+                webview.executeJavascript("if (cordova) cordova.fireDocumentEvent('resume')");
             }
         }
     };


Mime
View raw message