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

Commit

Permalink
default to the base href when dynamiceBase is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbender committed Oct 12, 2012
1 parent 291764c commit 411c33c
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions js/jquery.mobile.navigation.js
Expand Up @@ -1242,9 +1242,8 @@ define( [
allowSamePageTransition: false
};

/* Event Bindings - hashchange, submit, and click */
function findClosestLink( ele )
{
/* Event Bindings - hashchange, submit, and click */
function findClosestLink( ele ) {
while ( ele ) {
// Look for the closest element with a nodeName of "a".
// Note that we are checking if we have a valid nodeName
Expand All @@ -1262,17 +1261,16 @@ define( [
}

// The base URL for any given element depends on the page it resides in.
function getClosestBaseUrl( ele )
{
function getClosestBaseUrl( ele ) {
// Find the closest page and extract out its url.
var url = $( ele ).closest( ".ui-page" ).jqmData( "url" ),
base = documentBase.hrefNoHash;

if ( !url || !path.isPath( url ) ) {
if ( !$.mobile.dynamicBaseEnabled || !url || !path.isPath( url ) ) {
url = base;
}

return path.makeUrlAbsolute( url, base);
return path.makeUrlAbsolute( url, base );
}

//The following event bindings should be bound after mobileinit has been triggered
Expand Down

0 comments on commit 411c33c

Please sign in to comment.