Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
  • Loading branch information...
commit 3df35666d51d8ad6da62cee1f36b4c9afe827dc8 1 parent e79df14
@jsoref jsoref authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 framework/lib/framework.js
View
4 framework/lib/framework.js
@@ -24,13 +24,13 @@ var utils = require('./utils'),
pause: {
event: "inactive",
trigger: function () {
- webview.executeJavascript("if (cordova) cordova.fireDocumentEvent('pause')");
+ webview.executeJavascript("if (typeof cordova !== 'undefined') cordova.fireDocumentEvent('pause')");
}
},
resume: {
event: "active",
trigger: function () {
- webview.executeJavascript("if (cordova) cordova.fireDocumentEvent('resume')");
+ webview.executeJavascript("if (typeof cordova !== 'undefined') cordova.fireDocumentEvent('resume')");
}
}
};
Please sign in to comment.
Something went wrong with that request. Please try again.