mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-16 22:10:25 +00:00
disable the maxTransitionWidth during testing by default so that window width doesn't conflict with tests.
This commit is contained in:
parent
4f12d46945
commit
54aee8cb65
1 changed files with 13 additions and 0 deletions
|
|
@ -5,6 +5,7 @@
|
|||
var perspective = "viewport-flip",
|
||||
transitioning = "ui-mobile-viewport-transitioning",
|
||||
animationCompleteFn = $.fn.animationComplete,
|
||||
defaultMaxTrans = $.mobile.maxTransitionWidth,
|
||||
|
||||
//TODO centralize class names?
|
||||
transitionTypes = "in out fade slide flip reverse pop",
|
||||
|
|
@ -18,6 +19,14 @@
|
|||
isTransitioningIn = function(page){
|
||||
return page.hasClass("in") && isTransitioning(page);
|
||||
},
|
||||
|
||||
disableMaxTransWidth = function(){
|
||||
$.mobile.maxTransitionWidth = false;
|
||||
},
|
||||
|
||||
enableMaxTransWidth = function(){
|
||||
$.mobile.maxTransitionWidth = defaultMaxTrans;
|
||||
},
|
||||
|
||||
//animationComplete callback queue
|
||||
fromQueue = [],
|
||||
|
|
@ -46,6 +55,9 @@
|
|||
|
||||
module('jquery.mobile.navigation.js', {
|
||||
setup: function(){
|
||||
// disable this option so we can test transitions regardless of window width
|
||||
disableMaxTransWidth();
|
||||
|
||||
//stub to allow callback before function is returned to transition handler
|
||||
$.fn.animationComplete = function( callback ){
|
||||
animationCompleteFn.call( this, function(){
|
||||
|
|
@ -65,6 +77,7 @@
|
|||
teardown: function(){
|
||||
// unmock animation complete
|
||||
$.fn.animationComplete = animationCompleteFn;
|
||||
enableMaxTransWidth();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue