From 8e570e3f94846d6e01e3bf03da284db3c402979b Mon Sep 17 00:00:00 2001 From: Ghislain Seguin Date: Fri, 22 Jun 2012 22:20:50 -0700 Subject: [PATCH] Fixes #4340 Conflicts: js/jquery.mobile.transition.js --- js/jquery.mobile.navigation.js | 1 - js/jquery.mobile.transition.js | 30 ++++++++++++++---------------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/js/jquery.mobile.navigation.js b/js/jquery.mobile.navigation.js index dded568b936..d384b703341 100644 --- a/js/jquery.mobile.navigation.js +++ b/js/jquery.mobile.navigation.js @@ -1274,7 +1274,6 @@ define( [ removeActiveLinkClass( true ); $activeClickedLink = $( link ).closest( ".ui-btn" ).not( ".ui-disabled" ); $activeClickedLink.addClass( $.mobile.activeBtnClass ); - $( "." + $.mobile.activePageClass + " .ui-btn" ).not( link ).blur(); } } }); diff --git a/js/jquery.mobile.transition.js b/js/jquery.mobile.transition.js index a3cb5a98ef9..cc2078c4660 100644 --- a/js/jquery.mobile.transition.js +++ b/js/jquery.mobile.transition.js @@ -25,7 +25,7 @@ var createHandler = function( sequential ){ toScroll = active.lastScroll || $.mobile.defaultHomeScroll, screenHeight = $.mobile.getScreenHeight(), maxTransitionOverride = $.mobile.maxTransitionWidth !== false && $( window ).width() > $.mobile.maxTransitionWidth, - none = !$.support.cssTransitions || maxTransitionOverride || !name || name === "none", + none = !$.support.cssTransitions || maxTransitionOverride || !name || name === "none" || Math.max( $( window ).scrollTop(), toScroll ) > $.mobile.getMaxScrollForTransition(), toPreClass = " ui-page-pre-in", toggleViewportClass = function(){ $.mobile.pageContainer.toggleClass( "ui-mobile-viewport-transitioning viewport-" + name ); @@ -71,14 +71,11 @@ var createHandler = function( sequential ){ startIn(); }, - - startIn = function(){ - - //prevent flickering in phonegap container - $to.css("z-index", -10); - - $to.addClass( $.mobile.activePageClass + toPreClass ); - + + startIn = function(){ + + $to.addClass( $.mobile.activePageClass ); + // Send focus to page as it is now display: block $.mobile.focusPage( $to ); @@ -87,16 +84,11 @@ var createHandler = function( sequential ){ scrollPage(); - //restores visibility of the new page - $to.css("z-index", ""); - if( !none ){ $to.animationComplete( doneIn ); } - $to - .removeClass( toPreClass ) - .addClass( name + " in" + reverseClass ); + $to.addClass( name + " in" + reverseClass ); if( none ){ doneIn(); @@ -157,7 +149,13 @@ $.mobile.transitionHandlers = { $.mobile.transitionFallbacks = {}; +$.mobile = $.extend( {}, { + getMaxScrollForTransition: function() { + return $.mobile.getScreenHeight() * 3; + } +}, $.mobile ); + })( jQuery, this ); //>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); }); -//>>excludeEnd("jqmBuildExclude"); +//>>excludeEnd("jqmBuildExclude"); \ No newline at end of file