Skip to content

Commit

Permalink
Navigation: Preserves hash parameters so a page can be reloaded or bo…
Browse files Browse the repository at this point in the history
…okmarked.

Fixes jquery-archive#5230 - Hash parameters get stripped from the url when used in an
anchor
  • Loading branch information
James Linse committed Apr 19, 2013
1 parent 5ba1d42 commit b5b6535
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/jquery.mobile.navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,7 @@ define( [
// internal state and then trigger a transition to the page.
var fromPage = settings.fromPage,
url = ( settings.dataUrl && path.convertUrlToDataUrl( settings.dataUrl ) ) || toPage.jqmData( "url" ),
urlParameters = ( settings.dataUrl && settings.dataUrl.replace(/^[^?]*/, "") ) || "",
// The pageUrl var is usually the same as url, except when url is obscured as a dialog url. pageUrl always contains the file path
pageUrl = url,
fileUrl = path.getFilePath( url ),
Expand Down Expand Up @@ -909,7 +910,7 @@ define( [
};

if ( settings.changeHash !== false && $.mobile.hashListeningEnabled ) {
$.mobile.navigate( url, params, true);
$.mobile.navigate( url + urlParameters, params, true);
} else if ( toPage[ 0 ] !== $.mobile.firstPage[ 0 ] ) {
$.mobile.navigate.history.add( url, params );
}
Expand Down

0 comments on commit b5b6535

Please sign in to comment.