Permalink
Browse files

reused some code, removed a var

  • Loading branch information...
1 parent 9b1a30f commit 2a8d2123ffbb7f6c8fa2deab9a28bfad8b82cd64 scottjehl committed Mar 27, 2012
Showing with 7 additions and 5 deletions.
  1. +7 −5 js/jquery.mobile.transition.js
@@ -28,9 +28,11 @@ var createHandler = function( sequential ){
active = $.mobile.urlHistory.getActive(),
toScroll = active.lastScroll || $.mobile.defaultHomeScroll,
screenHeight = $.mobile.getScreenHeight(),
- viewportClass = "ui-mobile-viewport-transitioning viewport-" + name,
maxTransitionOverride = $.mobile.maxTransitionWidth !== false && $( window ).width() > $.mobile.maxTransitionWidth,
none = !$.support.cssTransitions || maxTransitionOverride || !name || name === "none",
+ toggleViewportClass = function(){
+ $.mobile.pageContainer.toggleClass( "ui-mobile-viewport-transitioning viewport-" + name );
+ },
cleanFrom = function(){
$from
.removeClass( $.mobile.activePageClass + " out in reverse " + name )
@@ -77,14 +79,14 @@ var createHandler = function( sequential ){
$to
.removeClass( "out in reverse " + name )
- .height( "" )
- .parent().removeClass( viewportClass );
+ .height( "" );
+
+ toggleViewportClass();
deferred.resolve( name, reverse, $to, $from, true );
};
- $to
- .parent().addClass( viewportClass );
+ toggleViewportClass();
if ( $from && !none ) {

0 comments on commit 2a8d212

Please sign in to comment.