You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2012/04/20 00:53:56 UTC
[4/8] git commit: [CB-499] requirejs on iOS messes up cordova-js
initialization. have to listen for DOMContentLoaded sooner
[CB-499] requirejs on iOS messes up cordova-js initialization. have to listen for DOMContentLoaded sooner
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/2a8cdb98
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/2a8cdb98
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/2a8cdb98
Branch: refs/heads/bada
Commit: 2a8cdb98b764fcdd513d049ea5a35d95c3a119e2
Parents: 44f82b8
Author: Fil Maj <ma...@gmail.com>
Authored: Wed Apr 18 13:50:59 2012 -0700
Committer: Fil Maj <ma...@gmail.com>
Committed: Wed Apr 18 13:50:59 2012 -0700
----------------------------------------------------------------------
lib/cordova.js | 11 +++++++++++
lib/scripts/bootstrap.js | 14 --------------
2 files changed, 11 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/2a8cdb98/lib/cordova.js
----------------------------------------------------------------------
diff --git a/lib/cordova.js b/lib/cordova.js
index e155b4f..e9cd5da 100644
--- a/lib/cordova.js
+++ b/lib/cordova.js
@@ -1,4 +1,15 @@
var channel = require('cordova/channel');
+
+/**
+ * Listen for DOMContentLoaded and notify our channel subscribers.
+ */
+document.addEventListener('DOMContentLoaded', function() {
+ channel.onDOMContentLoaded.fire();
+}, false);
+if (document.readyState == 'complete') {
+ channel.onDOMContentLoaded.fire();
+}
+
/**
* Intercept calls to addEventListener + removeEventListener and handle deviceready,
* resume, and pause events.
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/2a8cdb98/lib/scripts/bootstrap.js
----------------------------------------------------------------------
diff --git a/lib/scripts/bootstrap.js b/lib/scripts/bootstrap.js
index 5452561..9c3252f 100755
--- a/lib/scripts/bootstrap.js
+++ b/lib/scripts/bootstrap.js
@@ -2,20 +2,6 @@
var channel = require("cordova/channel"),
_self = {
boot: function () {
- //---------------
- // Event handling
- //---------------
-
- /**
- * Listen for DOMContentLoaded and notify our channel subscribers.
- */
- document.addEventListener('DOMContentLoaded', function() {
- channel.onDOMContentLoaded.fire();
- }, false);
- if (document.readyState == 'complete') {
- channel.onDOMContentLoaded.fire();
- }
-
/**
* Create all cordova objects once page has fully loaded and native side is ready.
*/