Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make changePage working properly on PhoneGap with WP7

  • Loading branch information...
commit f3b7c27196b6567e55049e96b5db2f6659a8b582 1 parent 7273a5e
gz authored
View
6 js/jquery.mobile.navigation.js
@@ -53,8 +53,8 @@ define( [
// browsers that auto decode it. All references to location.href should be
// replaced with a call to this method so that it can be dealt with properly here
getLocation: function( url ) {
- var uri = url ? this.parseUrl( url ) : location,
- hash = this.parseUrl( url || location.href ).hash;
+ var url = this.parseUrl( url || location.href ),
+ hash = uri.hash;
// mimic the browser with an empty string when the hash is empty
hash = hash === "#" ? "" : hash;
@@ -62,7 +62,7 @@ define( [
// Make sure to parse the url or the location object for the hash because using location.hash
// is autodecoded in firefox, the rest of the url should be from the object (location unless
// we're testing) to avoid the inclusion of the authority
- return uri.protocol + "//" + uri.host + uri.pathname + uri.search + hash;
+ return uri.protocol + uri.doubleSlash + uri.host + uri.pathname + uri.search + hash;
},
parseLocation: function() {
View
4 tests/unit/navigation/navigation_helpers.js
@@ -250,6 +250,10 @@
equal( $.mobile.path.getLocation( allUriParts ), allUriParts.replace( "jblas:password@", "") );
});
+ test( "path.getLocation works properly on WP7 with PhoneGap", function() {
+ equal( $.mobile.path.getLocation("x-wmapp1:/app/www/index.html"), "x-wmapp1:/app/www/index.html" );
+ });
+
test( "calling mobile back uses phonegap's navigator object when present", function() {
var previous = $.mobile.phonegapNavigationEnabled;
Please sign in to comment.
Something went wrong with that request. Please try again.