Skip to content

Commit

Permalink
Prevent next hashchange after the pagebeforechange
Browse files Browse the repository at this point in the history
event has been canceled due to a hashchange.

This prevents additional calls to changePage.
  • Loading branch information
David Ellingsworth committed Apr 23, 2012
1 parent 65705a7 commit 9a3e556
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions js/jquery.mobile.navigation.js
Expand Up @@ -954,6 +954,9 @@ define( [
var index = urlHistory.indexOf( url ); var index = urlHistory.indexOf( url );


if( index > -1 && index != urlHistory.activeIndex) { if( index > -1 && index != urlHistory.activeIndex) {
// Prevent the next hashchange
urlHistory.ignoreNextHashChange = true;
// Change the current index in history.
window.history.go(urlHistory.activeIndex - index); window.history.go(urlHistory.activeIndex - index);
} }
} }
Expand Down

0 comments on commit 9a3e556

Please sign in to comment.