incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject js commit: [CB-908] wrap all event firing in a setimeout to work around iOS-specific issue with having UI code in resume handler
Date Wed, 13 Jun 2012 20:28:40 GMT
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 <maj.fil@gmail.com>
Authored: Wed Jun 13 13:29:10 2012 -0700
Committer: Fil Maj <maj.fil@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);
         }


Mime
View raw message