diff --git a/js/jquery.mobile.navigation.js b/js/jquery.mobile.navigation.js index 44841930..3dfcf31c 100755 --- a/js/jquery.mobile.navigation.js +++ b/js/jquery.mobile.navigation.js @@ -504,7 +504,7 @@ define( [ //find the transition handler for the specified transition. If there //isn't one in our transitionHandlers dictionary, use the default one. //call the handler immediately to kick-off the transition. - var th = $.mobile.transitionHandlers[transition || "none"] || $.mobile.defaultTransitionHandler, + var th = $.mobile.transitionHandlers[ transition || "default" ] || $.mobile.defaultTransitionHandler, promise = th( transition, reverse, toPage, fromPage ); promise.done(function() { @@ -581,58 +581,7 @@ define( [ $.mobile.dialogHashKey = dialogHashKey; - //default non-animation transition handler - $.mobile.noneTransitionHandler = function( name, reverse, $to, $from ) { - var active = $.mobile.urlHistory.getActive(), - touchOverflow = $.support.touchOverflow && $.mobile.touchOverflowEnabled, - toScroll = active.lastScroll || ( touchOverflow ? 0 : $.mobile.defaultHomeScroll ), - viewportClass = "ui-mobile-viewport-transitioning viewport-" + name, - screenHeight = $.mobile.getScreenHeight(); - - if( !touchOverflow){ - $to.height( screenHeight + toScroll ); - } - - if( touchOverflow && toScroll ){ - - $to.addClass( "ui-mobile-pre-transition" ); - - // 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" ) ){ - $to.find( ".ui-content" ).scrollTop( toScroll ); - } - else{ - $to.scrollTop( toScroll ); - } - } - - //clear page loader - $.mobile.hidePageLoadingMsg(); - - if ( $from ) { - $from.removeClass( $.mobile.activePageClass ); - } - - $to.addClass( $.mobile.activePageClass ); - - // Jump to top or prev scroll, sometimes on iOS the page has not rendered yet. - if( !touchOverflow ){ - $.mobile.silentScroll( toScroll ); - } - - return $.Deferred().resolve( name, reverse, $to, $from ).promise(); - }; - - //default handler for unknown transitions - $.mobile.defaultTransitionHandler = $.mobile.noneTransitionHandler; - - //transition handler dictionary for 3rd party transitions - $.mobile.transitionHandlers = { - none: $.mobile.defaultTransitionHandler - }; + //enable cross-domain page support $.mobile.allowCrossDomainPages = false; diff --git a/js/jquery.mobile.transition.js b/js/jquery.mobile.transition.js index 6d07b0e7..ec87d671 100644 --- a/js/jquery.mobile.transition.js +++ b/js/jquery.mobile.transition.js @@ -13,6 +13,7 @@ function outInTransitionHandler( name, reverse, $to, $from ) { toScroll = active.lastScroll || ( touchOverflow ? 0 : $.mobile.defaultHomeScroll ), screenHeight = $.mobile.getScreenHeight(), viewportClass = "ui-mobile-viewport-transitioning viewport-" + name, + none = !$.support.cssTransitions || !name || name === "none", doneOut = function() { if ( $from ) { @@ -21,9 +22,11 @@ function outInTransitionHandler( name, reverse, $to, $from ) { .height( "" ); } - $to - .animationComplete( doneIn ) - .addClass( $.mobile.activePageClass ); + $to.addClass( $.mobile.activePageClass ); + + if( !none ){ + $to.animationComplete( doneIn ); + } // Send focus to page as it is now display: block $.mobile.focusPage( $to ); @@ -45,13 +48,16 @@ function outInTransitionHandler( name, reverse, $to, $from ) { $.mobile.silentScroll( toScroll ); } - + $to.addClass( name + " in" + reverseClass ); + if( none ){ + doneIn(); + } + }, doneIn = function() { - $to .removeClass( "out in reverse " + name ) .parent().removeClass( viewportClass ) @@ -66,10 +72,10 @@ function outInTransitionHandler( name, reverse, $to, $from ) { //clear page loader $.mobile.hidePageLoadingMsg(); - if ( $from ) { + if ( $from && !none ) { $from - .height( screenHeight + $(window ).scrollTop() ) .animationComplete( doneOut ) + .height( screenHeight + $(window ).scrollTop() ) .addClass( name + " out" + reverseClass ); } else { @@ -79,15 +85,15 @@ function outInTransitionHandler( name, reverse, $to, $from ) { return deferred.promise(); } -// Make our transition handler public. -$.mobile.outInTransitionHandler = outInTransitionHandler; - -// If the default transition handler is the 'none' handler, replace it with our handler. -if ( $.mobile.defaultTransitionHandler === $.mobile.noneTransitionHandler ) { - $.mobile.defaultTransitionHandler = outInTransitionHandler; -} - // add class for where 3d transforms are supported, or not $( "html" ).addClass( $.support.cssTransform3d ? "ui-supported-csstransform3d" : "ui-unsupported-csstransform3d" ); +// Make our transition handler the public default. +$.mobile.defaultTransitionHandler = outInTransitionHandler; + +//transition handler dictionary for 3rd party transitions +$.mobile.transitionHandlers = { + "default": $.mobile.defaultTransitionHandler +}; + })( jQuery, this );