Skip to content
This repository
Browse code

[init] Proceed to hashchange handler when the initial hash contains a…

… path
  • Loading branch information...
commit 34c4811b2a779c025576d08aff22963b7ca83323 1 parent b43ec24
Gabriel "_|Nix|_" Schulhof authored May 27, 2012

Showing 1 changed file with 5 additions and 1 deletion. Show diff stats Hide diff stats

  1. 6  js/jquery.mobile.init.js
6  js/jquery.mobile.init.js
@@ -145,7 +145,11 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.support", "./jquery
145 145
 			// if hashchange listening is disabled, there's no hash deeplink,
146 146
 			// the hash is not valid (contains more than one # or does not start with #)
147 147
 			// or there is no page with that hash, change to the first page in the DOM
148  
-			if ( !$.mobile.hashListeningEnabled || !$.mobile.path.isHashValid( location.hash ) || !$( location.hash + ':jqmData(role="page")' ).length ) {
  148
+			// Remember, however, that the hash can also be a path!
  149
+			if ( ! ( $.mobile.hashListeningEnabled &&
  150
+			         $.mobile.path.isHashValid( location.hash ) &&
  151
+			         ( $( location.hash + ':jqmData(role="page")' ).length ||
  152
+			           $.mobile.path.isPath( location.hash ) ) ) ) {
149 153
 				$.mobile.changePage( $.mobile.firstPage, { transition: "none", reverse: true, changeHash: false, fromHashChange: true } );
150 154
 			}
151 155
 			// otherwise, trigger a hashchange to load a deeplink

0 notes on commit 34c4811

Please sign in to comment.
Something went wrong with that request. Please try again.