From 6152e8f51140e06104fba3bdb9af5a116764947d Mon Sep 17 00:00:00 2001 From: Bra1n Date: Mon, 7 Feb 2011 23:50:30 +0100 Subject: [PATCH] fixed page history direction search for duplicate entries --- js/jquery.mobile.navigation.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/js/jquery.mobile.navigation.js b/js/jquery.mobile.navigation.js index d688b6c6..48d07e58 100644 --- a/js/jquery.mobile.navigation.js +++ b/js/jquery.mobile.navigation.js @@ -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;