Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
path.getDocumentUrl is defined twice
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbender committed Dec 19, 2012
1 parent 04b6562 commit bbe2068
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
23 changes: 10 additions & 13 deletions js/jquery.mobile.navigation.js
Expand Up @@ -52,14 +52,14 @@ define( [
$base = $head.children( "base" ),

//tuck away the original document URL minus any fragment.
documentUrl = path.parseLocation(),
documentUrl = path.documentUrl,

//if the document has an embedded base tag, documentBase is set to its
//initial value. If a base tag does not exist, then we default to the documentUrl.
documentBase = $base.length ? path.parseUrl( path.makeUrlAbsolute( $base.attr( "href" ), documentUrl.href ) ) : documentUrl,
documentBase = path.documentBase,

//cache the comparison once.
documentBaseDiffers = ( documentUrl.hrefNoHash !== documentBase.hrefNoHash ),
documentBaseDiffers = path.documentBaseDiffers,

getScreenHeight = $.mobile.getScreenHeight;

Expand All @@ -82,6 +82,13 @@ define( [

} : undefined;


//return the original document url
$.mobile.getDocumentUrl = path.getDocumentUrl;

//return the original document base url
$.mobile.getDocumentBase = path.getDocumentBase;

/* internal utility functions */

// NOTE Issue #4950 Android phonegap doesn't navigate back properly
Expand Down Expand Up @@ -294,16 +301,6 @@ define( [
//enable cross-domain page support
$.mobile.allowCrossDomainPages = false;

//return the original document url
$.mobile.getDocumentUrl = function( asParsedObject ) {
return asParsedObject ? $.extend( {}, documentUrl ) : documentUrl.href;
};

//return the original document base url
$.mobile.getDocumentBase = function( asParsedObject ) {
return asParsedObject ? $.extend( {}, documentBase ) : documentBase.href;
};

$.mobile._bindPageRemove = function() {
var page = $( this );

Expand Down
4 changes: 2 additions & 2 deletions js/navigation/path.js
Expand Up @@ -379,12 +379,12 @@ define([
path.documentBaseDiffers = (path.documentUrl.hrefNoHash !== path.documentBase.hrefNoHash);

//return the original document url
path.getDocumentUrl = $.mobile.getDocumentUrl = function( asParsedObject ) {
path.getDocumentUrl = function( asParsedObject ) {
return asParsedObject ? $.extend( {}, path.documentUrl ) : path.documentUrl.href;
};

//return the original document base url
path.getDocumentUrl = $.mobile.getDocumentBase = function( asParsedObject ) {
path.getDocumentBase = function( asParsedObject ) {
return asParsedObject ? $.extend( {}, path.documentBase ) : path.documentBase.href;
};

Expand Down

0 comments on commit bbe2068

Please sign in to comment.