From 8803bee3bb6dc19037e718c7db91cde01e6dbd03 Mon Sep 17 00:00:00 2001 From: John Bender Date: Tue, 8 Mar 2011 14:59:23 -0800 Subject: [PATCH] fixed zero index bug for directHashChange --- js/jquery.mobile.navigation.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/jquery.mobile.navigation.js b/js/jquery.mobile.navigation.js index 753028ae..6c64fb4c 100644 --- a/js/jquery.mobile.navigation.js +++ b/js/jquery.mobile.navigation.js @@ -118,7 +118,7 @@ }, directHashChange: function(opts){ - var back , forward, newActiveIndex; + var back , forward, newActiveIndex = null; // check if url isp in history and if it's ahead or behind current page $.each( this.stack, function( i, historyEntry ){ @@ -132,8 +132,8 @@ } }); - // save new page index - this.activeIndex = newActiveIndex ? newActiveIndex : this.activeIndex; + // save new page index, null check to prevent falsey 0 result + this.activeIndex = newActiveIndex != null ? newActiveIndex : this.activeIndex; if( back ){ opts.isBack();