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/06/13 22:28:40 UTC

js commit: [CB-908] wrap all event firing in a setimeout to work around iOS-specific issue with having UI code in resume handler

Updated Branches:
  refs/heads/master 056c797b2 -> 97e4a5cb9


[CB-908] wrap all event firing in a setimeout to work around iOS-specific issue with having UI code in resume handler


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/97e4a5cb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/97e4a5cb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/97e4a5cb

Branch: refs/heads/master
Commit: 97e4a5cb94aeb82261ffb07601218cef9854ae0e
Parents: 056c797
Author: Fil Maj <ma...@gmail.com>
Authored: Wed Jun 13 13:29:10 2012 -0700
Committer: Fil Maj <ma...@gmail.com>
Committed: Wed Jun 13 13:29:10 2012 -0700

----------------------------------------------------------------------
 lib/cordova.js |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/97e4a5cb/lib/cordova.js
----------------------------------------------------------------------
diff --git a/lib/cordova.js b/lib/cordova.js
index 32daed3..596e83b 100644
--- a/lib/cordova.js
+++ b/lib/cordova.js
@@ -119,7 +119,9 @@ var cordova = {
     fireDocumentEvent: function(type, data) {
         var evt = createEvent(type, data);
         if (typeof documentEventHandlers[type] != 'undefined') {
-            documentEventHandlers[type].fire(evt);
+            setTimeout(function() {
+                documentEventHandlers[type].fire(evt);
+            }, 0);
         } else {
             document.dispatchEvent(evt);
         }
@@ -127,7 +129,9 @@ var cordova = {
     fireWindowEvent: function(type, data) {
         var evt = createEvent(type,data);
         if (typeof windowEventHandlers[type] != 'undefined') {
-            windowEventHandlers[type].fire(evt);
+            setTimeout(function() {
+                windowEventHandlers[type].fire(evt);
+            }, 0);
         } else {
             window.dispatchEvent(evt);
         }