diff --git a/js/jquery.mobile.navigation.js b/js/jquery.mobile.navigation.js index 6661fda4..81c711ed 100644 --- a/js/jquery.mobile.navigation.js +++ b/js/jquery.mobile.navigation.js @@ -173,6 +173,12 @@ //kill the keyboard $( window.document.activeElement ).add(':focus').blur(); + function defaultTransition(){ + if(transition === undefined){ + transition = $.mobile.defaultTransition; + } + } + // if the new href is the same as the previous one if ( back ) { var pop = urlStack.pop(); @@ -181,9 +187,12 @@ if( pop && !transition ){ transition = pop.transition; } + + // ensure a transition has been set where pop is undefined + defaultTransition(); } else { - // if no transition passed set the default - transition = transition || $.mobile.defaultTransition; + // If no transition has been passed + defaultTransition(); // push the url and transition onto the stack urlStack.push({ url: url, transition: transition }); @@ -247,8 +256,6 @@ addContainerClass('ui-mobile-viewport-perspective'); } - console.log(transition); - addContainerClass('ui-mobile-viewport-transitioning'); // animate in / out diff --git a/tests/unit/navigation/index.html b/tests/unit/navigation/index.html index ae4b0243..d2910d52 100644 --- a/tests/unit/navigation/index.html +++ b/tests/unit/navigation/index.html @@ -12,7 +12,7 @@ - +n @@ -84,5 +84,9 @@
+ +