Skip to content
This repository
Browse code

path.getDocumentUrl is defined twice

  • Loading branch information...
commit bbe20689628d4015cb99fc4fdbf0bf24f60eaaef 1 parent 04b6562
John Bender authored December 19, 2012
23  js/jquery.mobile.navigation.js
@@ -52,14 +52,14 @@ define( [
52 52
 		$base = $head.children( "base" ),
53 53
 
54 54
 		//tuck away the original document URL minus any fragment.
55  
-		documentUrl = path.parseLocation(),
  55
+		documentUrl = path.documentUrl,
56 56
 
57 57
 		//if the document has an embedded base tag, documentBase is set to its
58 58
 		//initial value. If a base tag does not exist, then we default to the documentUrl.
59  
-		documentBase = $base.length ? path.parseUrl( path.makeUrlAbsolute( $base.attr( "href" ), documentUrl.href ) ) : documentUrl,
  59
+		documentBase = path.documentBase,
60 60
 
61 61
 		//cache the comparison once.
62  
-		documentBaseDiffers = ( documentUrl.hrefNoHash !== documentBase.hrefNoHash ),
  62
+		documentBaseDiffers = path.documentBaseDiffers,
63 63
 
64 64
 		getScreenHeight = $.mobile.getScreenHeight;
65 65
 
@@ -82,6 +82,13 @@ define( [
82 82
 
83 83
 		} : undefined;
84 84
 
  85
+
  86
+	//return the original document url
  87
+	$.mobile.getDocumentUrl = path.getDocumentUrl;
  88
+
  89
+	//return the original document base url
  90
+	$.mobile.getDocumentBase = path.getDocumentBase;
  91
+
85 92
 	/* internal utility functions */
86 93
 
87 94
 	// NOTE Issue #4950 Android phonegap doesn't navigate back properly
@@ -294,16 +301,6 @@ define( [
294 301
 	//enable cross-domain page support
295 302
 	$.mobile.allowCrossDomainPages = false;
296 303
 
297  
-	//return the original document url
298  
-	$.mobile.getDocumentUrl = function( asParsedObject ) {
299  
-		return asParsedObject ? $.extend( {}, documentUrl ) : documentUrl.href;
300  
-	};
301  
-
302  
-	//return the original document base url
303  
-	$.mobile.getDocumentBase = function( asParsedObject ) {
304  
-		return asParsedObject ? $.extend( {}, documentBase ) : documentBase.href;
305  
-	};
306  
-
307 304
 	$.mobile._bindPageRemove = function() {
308 305
 		var page = $( this );
309 306
 
4  js/navigation/path.js
@@ -379,12 +379,12 @@ define([
379 379
 		path.documentBaseDiffers = (path.documentUrl.hrefNoHash !== path.documentBase.hrefNoHash);
380 380
 
381 381
 		//return the original document url
382  
-		path.getDocumentUrl = $.mobile.getDocumentUrl = function( asParsedObject ) {
  382
+		path.getDocumentUrl = function( asParsedObject ) {
383 383
 			return asParsedObject ? $.extend( {}, path.documentUrl ) : path.documentUrl.href;
384 384
 		};
385 385
 
386 386
 		//return the original document base url
387  
-		path.getDocumentUrl = $.mobile.getDocumentBase = function( asParsedObject ) {
  387
+		path.getDocumentBase = function( asParsedObject ) {
388 388
 			return asParsedObject ? $.extend( {}, path.documentBase ) : path.documentBase.href;
389 389
 		};
390 390
 

0 notes on commit bbe2068

Please sign in to comment.
Something went wrong with that request. Please try again.