Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

… path
  • Loading branch information...
commit 34c4811b2a779c025576d08aff22963b7ca83323 1 parent b43ec24
Gabriel "_|Nix|_" Schulhof gabrielschulhof authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 js/jquery.mobile.init.js
6 js/jquery.mobile.init.js
View
@@ -145,7 +145,11 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.support", "./jquery
// if hashchange listening is disabled, there's no hash deeplink,
// the hash is not valid (contains more than one # or does not start with #)
// or there is no page with that hash, change to the first page in the DOM
- if ( !$.mobile.hashListeningEnabled || !$.mobile.path.isHashValid( location.hash ) || !$( location.hash + ':jqmData(role="page")' ).length ) {
+ // Remember, however, that the hash can also be a path!
+ if ( ! ( $.mobile.hashListeningEnabled &&
+ $.mobile.path.isHashValid( location.hash ) &&
+ ( $( location.hash + ':jqmData(role="page")' ).length ||
+ $.mobile.path.isPath( location.hash ) ) ) ) {
$.mobile.changePage( $.mobile.firstPage, { transition: "none", reverse: true, changeHash: false, fromHashChange: true } );
}
// otherwise, trigger a hashchange to load a deeplink
Please sign in to comment.
Something went wrong with that request. Please try again.