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

Commit 9ac84e3

Browse files
committed
switch transition handlers to objects refs
1 parent 524f047 commit 9ac84e3

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

js/jquery.mobile.navigation.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ define( [
690690
var transition = options.transition,
691691
reverse = options.reverse,
692692
deferred = options.deferred,
693-
transitionHandler,
693+
TransitionHandler,
694694
promise;
695695

696696
// TODO decide if these events should in fact be triggered on the container
@@ -711,9 +711,10 @@ define( [
711711
//find the transition handler for the specified transition. If there
712712
//isn't one in our transitionHandlers dictionary, use the default one.
713713
//call the handler immediately to kick-off the transition.
714-
transitionHandler = $.mobile.transitionHandlers[ transition || "default" ] || $.mobile.defaultTransitionHandler;
714+
TransitionHandler = $.mobile.transitionHandlers[ transition || "default" ] ||
715+
$.mobile.defaultTransitionHandler;
715716

716-
promise = transitionHandler( transition, reverse, toPage, fromPage );
717+
promise = (new TransitionHandler( transition, reverse, toPage, fromPage )).transition();
717718

718719
// TODO temporary accomodation of argument deferred
719720
promise.done(function() {

js/transitions/handlers.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,14 @@ define( ["jquery", "../jquery.mobile.core", "./serial", "./concurrent"], functio
1515

1616
//transition handler dictionary for 3rd party transitions
1717
$.mobile.transitionHandlers = {
18-
"default": $.mobile.defaultTransitionHandler,
19-
"sequential": function( name, reverse, to, from ) {
20-
return (new $.mobile.SerialTransition( name, reverse, to, from )).transition();
21-
},
22-
23-
"simultaneous": function( name, reverse, to, from ) {
24-
return (new $.mobile.ConcurrentTransition( name, reverse, to, from )).transition();
25-
}
18+
"sequential": $.mobile.SerialTransition,
19+
"simultaneous": $.mobile.ConcurrentTransition
2620
};
2721

2822
// Make our transition handler the public default.
2923
$.mobile.defaultTransitionHandler = $.mobile.transitionHandlers.sequential;
30-
$.mobile.transitionHandlers["default"] = $.mobile.defaultTransitionHandler;
24+
25+
$.mobile.transitionHandlers[ "default" ] = $.mobile.defaultTransitionHandler;
3126

3227
$.mobile.transitionFallbacks = {};
3328

0 commit comments

Comments
 (0)