incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject [3/7] git commit: Use backHistory on Android
Date Thu, 19 Jan 2012 01:30:49 GMT
Use backHistory on Android


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-mobile-spec/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-mobile-spec/commit/025231f7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-mobile-spec/tree/025231f7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-mobile-spec/diff/025231f7

Branch: refs/heads/master
Commit: 025231f7c6c07286a4605fa5d0bc65c1ad6ac115
Parents: efbebaa
Author: macdonst <simon.macdonald@gmail.com>
Authored: Fri Dec 16 10:32:06 2011 -0500
Committer: macdonst <simon.macdonald@gmail.com>
Committed: Fri Dec 16 10:32:06 2011 -0500

----------------------------------------------------------------------
 phonegap.js |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-mobile-spec/blob/025231f7/phonegap.js
----------------------------------------------------------------------
diff --git a/phonegap.js b/phonegap.js
index 4af885a..fb81ebd 100755
--- a/phonegap.js
+++ b/phonegap.js
@@ -2,5 +2,10 @@ document.write('<script type="text/javascript" charset="utf-8" src="../phonegap-
 document.write('<script type="text/javascript" charset="utf-8" src="phonegap-1.2.0.js"></script>');
 
 function backHome() {
-	document.location = "../index.html";
+	if (device.platform.toLowerCase() == 'android') {
+            navigator.app.backHistory();
+	}
+	else {
+	    document.location = "../index.html";
+	}
 }


Mime
View raw message