mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-28 03:30:27 +00:00
fixed page history direction search for duplicate entries
This commit is contained in:
parent
b4a8222366
commit
6152e8f511
1 changed files with 7 additions and 1 deletions
|
|
@ -287,6 +287,9 @@
|
|||
// guess if it came from the history menu
|
||||
if( fromHashChange ){
|
||||
|
||||
// determine new page index
|
||||
var newActiveIndex = null;
|
||||
|
||||
// check if url is in history and if it's ahead or behind current page
|
||||
$.each( urlHistory.stack, function( i ){
|
||||
//if the url is in the stack, it's a forward or a back
|
||||
|
|
@ -297,10 +300,13 @@
|
|||
//forward set to opposite of back
|
||||
forward = !back;
|
||||
//reset activeIndex to this one
|
||||
urlHistory.activeIndex = i;
|
||||
newActiveIndex = i;
|
||||
}
|
||||
});
|
||||
|
||||
// save new page index
|
||||
urlHistory.activeIndex = ( newActiveIndex != null ? newActiveIndex : urlHistory.activeIndex );
|
||||
|
||||
//if it's a back, use reverse animation
|
||||
if( back ){
|
||||
reverse = true;
|
||||
|
|
|
|||
Loading…
Reference in a new issue