From b438472fec689ddd1fdcfc751e76e459dbf4d574 Mon Sep 17 00:00:00 2001 From: scottjehl Date: Thu, 18 Aug 2011 22:41:13 -0400 Subject: [PATCH] if no hash is present, run a replacestate. All nav tests still passing. --- js/jquery.mobile.navigation.pushstate.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/jquery.mobile.navigation.pushstate.js b/js/jquery.mobile.navigation.pushstate.js index 7ef8de90..96bdd15d 100644 --- a/js/jquery.mobile.navigation.pushstate.js +++ b/js/jquery.mobile.navigation.pushstate.js @@ -60,6 +60,11 @@ // Handle popstate events the occur through history changes $win.bind( "popstate", self.onPopState ); + + // if there's no hash, we need to replacestate for returning to home + if( location.hash === "" ){ + history.replaceState( { hash: location.hash, title: document.title }, document.title, location.href ); + } // Enable pushstate listening *after window onload // To ignore the initial pop that Chrome calls at onload