Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Commit 02cd324

Browse files
author
Gabriel Schulhof
committed
[init] Proceed to hashchange handler when the initial hash contains a path
1 parent cf1c009 commit 02cd324

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

js/jquery.mobile.init.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,11 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.support", "./jquery
8080
// if hashchange listening is disabled, there's no hash deeplink,
8181
// the hash is not valid (contains more than one # or does not start with #)
8282
// or there is no page with that hash, change to the first page in the DOM
83-
if ( !$.mobile.hashListeningEnabled || !$.mobile.path.isHashValid( location.hash ) || !$( location.hash + ':jqmData(role="page")' ).length ) {
83+
// Remember, however, that the hash can also be a path!
84+
if ( ! ( $.mobile.hashListeningEnabled &&
85+
$.mobile.path.isHashValid( location.hash ) &&
86+
( $( location.hash + ':jqmData(role="page")' ).length ||
87+
$.mobile.path.isPath( location.hash ) ) ) ) {
8488
$.mobile.changePage( $.mobile.firstPage, { transition: "none", reverse: true, changeHash: false, fromHashChange: true } );
8589
}
8690
// otherwise, trigger a hashchange to load a deeplink

0 commit comments

Comments
 (0)