From 20dce2ce4294c4036ed057902d7f02c3c3086b4a Mon Sep 17 00:00:00 2001 From: John Bender Date: Fri, 25 Feb 2011 23:20:56 -0800 Subject: [PATCH] small refactor to simplify newActiveIndex tracking --- js/jquery.mobile.navigation.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/jquery.mobile.navigation.js b/js/jquery.mobile.navigation.js index 6041ac67..58b549a1 100644 --- a/js/jquery.mobile.navigation.js +++ b/js/jquery.mobile.navigation.js @@ -288,7 +288,7 @@ if( fromHashChange ){ // determine new page index - var newActiveIndex = null; + var newActiveIndex; // check if url is in history and if it's ahead or behind current page $.each( urlHistory.stack, function( i ){ @@ -304,7 +304,7 @@ }); // save new page index - urlHistory.activeIndex = ( newActiveIndex != null ? newActiveIndex : urlHistory.activeIndex ); + urlHistory.activeIndex = newActiveIndex ? newActiveIndex : urlHistory.activeIndex; //if it's a back, use reverse animation if( back ){