implemented fallback transition definitions for non-3D-supporting browsers, for all transitions except "fade". By default, these are all set to fall back to "fade", and they'll fall back to "none" if 3D is unsupported and no fallback is defined. They can be overridden at mobileinit, like any other jQM default.

This commit is contained in:
scottjehl 2012-01-09 16:22:57 +07:00
parent a237c5f2e1
commit a3e776297e
7 changed files with 58 additions and 0 deletions

View file

@ -18,6 +18,12 @@ $files = array(
'jquery.mobile.navigation.js',
'jquery.mobile.navigation.pushstate.js',
'jquery.mobile.transition.js',
'jquery.mobile.transition.js',
'jquery.mobile.transition.pop.js',
'jquery.mobile.transition.slide.js',
'jquery.mobile.transition.slidedown.js',
'jquery.mobile.transition.slideup.js',
'jquery.mobile.transition.flip.js',
'jquery.mobile.degradeInputs.js',
'jquery.mobile.dialog.js',
'jquery.mobile.page.sections.js',

View file

@ -0,0 +1,9 @@
/*
* fallback transition for flip in non-3D supporting browsers (which tend to handle complex transitions poorly in general
*/
(function( $, window, undefined ) {
$.mobile.transitionFallbacks.flip = "fade";
})( jQuery, this );

View file

@ -6,6 +6,11 @@
function outInTransitionHandler( name, reverse, $to, $from ) {
// first, override name if there's no 3D transform support and a fallback is defined
if( name && !$.support.cssTransform3d ){
name = $.mobile.transitionFallbacks[ name ] || "none";
}
var deferred = new $.Deferred(),
reverseClass = reverse ? " reverse" : "",
active = $.mobile.urlHistory.getActive(),
@ -97,4 +102,6 @@ $.mobile.transitionHandlers = {
"default": $.mobile.defaultTransitionHandler
};
$.mobile.transitionFallbacks = {};
})( jQuery, this );

View file

@ -0,0 +1,9 @@
/*
* fallback transition for pop in non-3D supporting browsers (which tend to handle complex transitions poorly in general
*/
(function( $, window, undefined ) {
$.mobile.transitionFallbacks.pop = "fade";
})( jQuery, this );

View file

@ -0,0 +1,9 @@
/*
* fallback transition for slide in non-3D supporting browsers (which tend to handle complex transitions poorly in general
*/
(function( $, window, undefined ) {
$.mobile.transitionFallbacks.slide = "fade";
})( jQuery, this );

View file

@ -0,0 +1,9 @@
/*
* fallback transition for slidedown in non-3D supporting browsers (which tend to handle complex transitions poorly in general
*/
(function( $, window, undefined ) {
$.mobile.transitionFallbacks.slidedown = "fade";
})( jQuery, this );

View file

@ -0,0 +1,9 @@
/*
* fallback transition for slideup in non-3D supporting browsers (which tend to handle complex transitions poorly in general
*/
(function( $, window, undefined ) {
$.mobile.transitionFallbacks.slideup = "fade";
})( jQuery, this );