Permalink
Browse files

move the hash alteration below the snippets that determine the data t…

…hat will go into a navigate call
  • Loading branch information...
1 parent 66edbea commit 397479452d5467f95f238aed350627836ea0d710 @johnbender johnbender committed Oct 25, 2012
Showing with 14 additions and 8 deletions.
  1. +8 −8 js/jquery.mobile.navigation.js
  2. +6 −0 js/navigation/navigate.js
@@ -875,14 +875,6 @@ define( [
}
}
- // Set the location hash.
- if ( settings.changeHash !== false && url ) {
- //disable hash listening temporarily
- urlHistory.ignoreNextHashChange = true;
- //update hash and history
- path.set( url );
- }
-
// if title element wasn't found, try the page div data attr too
// If this is a deep-link or a reload ( active === undefined ) then just use pageTitle
var newPageTitle = ( !active )? pageTitle : toPage.jqmData( "title" ) || toPage.children( ":jqmData(role='header')" ).find( ".ui-title" ).getEncodedText();
@@ -907,6 +899,14 @@ define( [
urlHistory.addNew( url, settings.transition, pageTitle, pageUrl, settings.role );
}
+ // Set the location hash.
+ if ( settings.changeHash !== false && url ) {
+ //disable hash listening temporarily
+ urlHistory.ignoreNextHashChange = true;
+ //update hash and history
+ path.set( url );
+ }
+
//set page title
document.title = urlHistory.getActive().title;
@@ -112,6 +112,12 @@ define([
return;
}
+ // account for initial page load popstate, and other popstates triggered
+ // by other parts of the application (ie, during the refactor)
+ if( !event.originalEvent.state ) {
+ return;
+ }
+
// If this is a popstate that comes from the back or forward buttons
// make sure to set the state of our history stack properly
history.direct({

0 comments on commit 3974794

Please sign in to comment.