Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Commit 67779af

Browse files
committed
abstract transistion default
1 parent 9ac84e3 commit 67779af

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

js/jquery.mobile.navigation.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,10 @@ define( [
685685
}, this);
686686
},
687687

688+
_getTransitionHandler: function( transition ) {
689+
return $.mobile.transitionHandlers[ transition ] || $.mobile.defaultTransitionHandler;
690+
},
691+
688692
// TODO make private once change has been defined in the widget1
689693
transition: function( toPage, fromPage, options ) {
690694
var transition = options.transition,
@@ -711,10 +715,10 @@ define( [
711715
//find the transition handler for the specified transition. If there
712716
//isn't one in our transitionHandlers dictionary, use the default one.
713717
//call the handler immediately to kick-off the transition.
714-
TransitionHandler = $.mobile.transitionHandlers[ transition || "default" ] ||
715-
$.mobile.defaultTransitionHandler;
718+
TransitionHandler = this._getTransitionHandler( transition );
716719

717-
promise = (new TransitionHandler( transition, reverse, toPage, fromPage )).transition();
720+
promise = (new TransitionHandler( transition, reverse, toPage, fromPage ))
721+
.transition();
718722

719723
// TODO temporary accomodation of argument deferred
720724
promise.done(function() {

js/transitions/handlers.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ define( ["jquery", "../jquery.mobile.core", "./serial", "./concurrent"], functio
2222
// Make our transition handler the public default.
2323
$.mobile.defaultTransitionHandler = $.mobile.transitionHandlers.sequential;
2424

25-
$.mobile.transitionHandlers[ "default" ] = $.mobile.defaultTransitionHandler;
26-
2725
$.mobile.transitionFallbacks = {};
2826

2927
// If transition is defined, check if css 3D transforms are supported, and if not, if a fallback is specified

0 commit comments

Comments
 (0)