diff --git a/js/jquery.mobile.navigation.js b/js/jquery.mobile.navigation.js index 954a295a..44841930 100755 --- a/js/jquery.mobile.navigation.js +++ b/js/jquery.mobile.navigation.js @@ -1150,7 +1150,7 @@ define( [ settings.reverse = settings.reverse || historyDir < 0; transitionPages( toPage, fromPage, settings.transition, settings.reverse ) - .done(function() { + .done(function( name, reverse, $to, $from, alreadyFocused ) { removeActiveLinkClass(); //if there's a duplicateCachedPage, remove it from the DOM now that it's hidden @@ -1165,7 +1165,9 @@ define( [ // itself to avoid ie bug that reports offsetWidth as > 0 (core check for visibility) // despite visibility: hidden addresses issue #2965 // https://github.com/jquery/jquery-mobile/issues/2965 - $.mobile.focusPage( toPage ); + if( !alreadyFocused ){ + $.mobile.focusPage( toPage ); + } releasePageTransitionLock(); diff --git a/js/jquery.mobile.transition.fadeoutin.js b/js/jquery.mobile.transition.fadeoutin.js index 7237148f..d53d34be 100644 --- a/js/jquery.mobile.transition.fadeoutin.js +++ b/js/jquery.mobile.transition.fadeoutin.js @@ -11,22 +11,21 @@ function fadeOutInTransitionHandler( name, reverse, $to, $from ) { active = $.mobile.urlHistory.getActive(), touchOverflow = $.support.touchOverflow && $.mobile.touchOverflowEnabled, toScroll = active.lastScroll || ( touchOverflow ? 0 : $.mobile.defaultHomeScroll ), - viewportClass = "ui-mobile-viewport-transitioning viewport-" + name, - preTransClass = "ui-mobile-pre-transition", + viewportClass = "viewport-" + name, doneOut = function() { if ( $from ) { - $from.removeClass( $.mobile.activePageClass + " " + preTransClass + " out in reverse " + name ); + $from.removeClass( $.mobile.activePageClass + " out in reverse " + name ); } $to .animationComplete( doneIn ) - .addClass( preTransClass ); + .addClass( $.mobile.activePageClass ); + // Send focus to page as it is now display: block + $.mobile.focusPage( $to ); + if( touchOverflow && toScroll ){ - - // Send focus to page as it is now display: block - $.mobile.focusPage( $to ); //set page's scrollTop to remembered distance if( $to.is( ".ui-native-fixed" ) ){ @@ -42,21 +41,19 @@ function fadeOutInTransitionHandler( name, reverse, $to, $from ) { $.mobile.silentScroll( toScroll ); } - $to.addClass( $.mobile.activePageClass + " " + name + " in" + reverseClass ); + $to.addClass( name + " in" + reverseClass ); }, doneIn = function() { $to - .removeClass( "out in reverse " + name + " " + preTransClass ) + .removeClass( "out in reverse " + name ) .parent().removeClass( viewportClass ); - deferred.resolve( name, reverse, $to, $from ); + deferred.resolve( name, reverse, $to, $from, true ); }; - $to.parent().addClass( viewportClass ); - //clear page loader $.mobile.hidePageLoadingMsg();