Permalink
Browse files

Navigation: Add to history without modifying the location.hash when h…

…istory is turned off
  • Loading branch information...
gabrielschulhof committed Jan 22, 2013
1 parent 20aa155 commit b1d8a00311ba5421bb764dbeb44f416680ff1a2a
Showing with 11 additions and 3 deletions.
  1. +11 −3 js/jquery.mobile.navigation.js
@@ -884,20 +884,28 @@ define( [
}
// Set the location hash.
if ( settings.changeHash !== false && url ) {
if ( url && !settings.fromHashChange ) {
var params;
// rebuilding the hash here since we loose it earlier on
// TODO preserve the originally passed in path
if( !path.isPath( url ) && url.indexOf( "#" ) < 0 ) {
url = "#" + url;
}
// TODO the property names here are just silly
$.mobile.navigate( url, {
params = {
transition: settings.transition,
title: pageTitle,
pageUrl: pageUrl,
role: settings.role
}, true);
};
if ( settings.changeHash !== false && $.mobile.hashListeningEnabled ) {
$.mobile.navigate( url, params, true);
} else if ( toPage[ 0 ] !== $.mobile.firstPage[ 0 ] ) {
$.mobile.navigate.history.add( url, params );
}
}
//set page title

0 comments on commit b1d8a00

Please sign in to comment.