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

Commit 5ba2cc9

Browse files
committed
Inverted the logic around ignoreNextHashChange so that it actually matches the name of the variable.
Modified the hashchange callback so that it specifies a "none" transition, instead of a false boolean, for the case where the hash changed and there is nothing on the urlHistory stack.
1 parent 3c792c5 commit 5ba2cc9

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

js/jquery.mobile.navigation.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@
174174

175175
//disable hashchange event listener internally to ignore one change
176176
//toggled internally when location.hash is updated to match the url of a successful page load
177-
ignoreNextHashChange: true
177+
ignoreNextHashChange: false
178178
},
179179

180180
//define first selector to receive focus when a page is shown
@@ -663,7 +663,7 @@
663663
// Set the location hash.
664664
if( settings.changeHash !== false && url ) {
665665
//disable hash listening temporarily
666-
urlHistory.ignoreNextHashChange = false;
666+
urlHistory.ignoreNextHashChange = true;
667667
//update hash and history
668668
path.set( url );
669669
}
@@ -883,14 +883,11 @@
883883
//find first page via hash
884884
var to = path.stripHash( location.hash ),
885885
//transition is false if it's the first page, undefined otherwise (and may be overridden by default)
886-
transition = $.mobile.urlHistory.stack.length === 0 ? false : undefined;
886+
transition = $.mobile.urlHistory.stack.length === 0 ? "none" : undefined;
887887

888888
//if listening is disabled (either globally or temporarily), or it's a dialog hash
889-
if( !$.mobile.hashListeningEnabled || !urlHistory.ignoreNextHashChange ) {
890-
if( !urlHistory.ignoreNextHashChange ) {
891-
urlHistory.ignoreNextHashChange = true;
892-
}
893-
889+
if( !$.mobile.hashListeningEnabled || urlHistory.ignoreNextHashChange ) {
890+
urlHistory.ignoreNextHashChange = false;
894891
return;
895892
}
896893

0 commit comments

Comments
 (0)