incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject [25/28] git commit: Modify lifecycle to match Android/iOS.
Date Tue, 03 Jan 2012 20:22:59 GMT
Modify lifecycle to match Android/iOS.

Remove the fire of resume on application load and add
a call to window.onunload() on application exit.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/commit/8bf61ec8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/tree/8bf61ec8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/diff/8bf61ec8

Branch: refs/heads/master
Commit: 8bf61ec8012bb5c54634562adc74992bc57e6e61
Parents: f1326c3
Author: Drew Walters <deedubbu@gmail.com>
Authored: Tue Nov 1 05:15:00 2011 +0800
Committer: Drew Walters <deedubbu@gmail.com>
Committed: Tue Nov 1 05:16:51 2011 +0800

----------------------------------------------------------------------
 javascript/_phonegap.js |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/8bf61ec8/javascript/_phonegap.js
----------------------------------------------------------------------
diff --git a/javascript/_phonegap.js b/javascript/_phonegap.js
index 9cebbcc..4ea2feb 100644
--- a/javascript/_phonegap.js
+++ b/javascript/_phonegap.js
@@ -252,9 +252,6 @@ var PhoneGap = PhoneGap || (function() {
         // PhoneGap info has been received from native side.
         PhoneGap.Channel.join(function() {
             PhoneGap.onDeviceReady.fire();
-            
-            // Fire the onresume event, since first one happens before JavaScript is loaded
-            PhoneGap.onResume.fire();
         }, PhoneGap.deviceReadyChannelsArray);    
         
     }, [ PhoneGap.onDOMContentLoaded, PhoneGap.onNativeReady ]);
@@ -454,7 +451,11 @@ var PhoneGap = PhoneGap || (function() {
      * extension chance to clean up before exiting.
      */
     blackberry.app.event.onExit(function() {
-        PhoneGap.onPause.fire();
+        // Call onunload if it is defined since BlackBerry does not invoke
+        // on application exit.
+        if (typeof window.onunload === "function") {
+            window.onunload();
+        }
 
         // allow PhoneGap JavaScript Extension opportunity to cleanup
         phonegap.PluginManager.destroy();


Mime
View raw message