From 82ed98cffc2f3deef64e8ffae5e67b2614b1b0b0 Mon Sep 17 00:00:00 2001 From: scottjehl Date: Thu, 26 Jan 2012 15:16:52 +0700 Subject: [PATCH] some edits to make sure proper classes are toggled for the slide transition to work, if it's set. --- js/jquery.mobile.fixedToolbar.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/js/jquery.mobile.fixedToolbar.js b/js/jquery.mobile.fixedToolbar.js index fede4ea1..bdae9ecc 100644 --- a/js/jquery.mobile.fixedToolbar.js +++ b/js/jquery.mobile.fixedToolbar.js @@ -191,22 +191,24 @@ define( [ "jquery", "./jquery.mobile.widget", "./jquery.mobile.core", "./jquery. elHeight = $el.height(), pHeight = $el.closest( ".ui-page" ).height(), viewportHeight = Math.min( screen.height, $win.height() ), - tbtype = $el.is( ".ui-header" ) ? "header" : "footer"; + tbtype = $el.is( ".ui-header" ) ? "header" : "footer", + // if it's a slide transition, our new transitions need the reverse class as well to slide outward + outclass = "out" + ( this.options.transition === "slide" ? " reverse" : "" ); - if( this.options.transition && this.options.transition !== "none" && + if( this.options.transition && this.options.transition !== "none" && ( ( tbtype === "header" && !this.options.fullscreen && scroll > elHeight ) || ( tbtype === "footer" && !this.options.fullscreen && scroll + viewportHeight < pHeight - elHeight ) ) || this.options.fullscreen ){ $el + .addClass( outclass ) .removeClass( "in" ) - .addClass( "out" ) .animationComplete( function(){ - $el.addClass( hideClass ); + $el.addClass( hideClass ).removeClass( outclass ); }); } else { - this.element.addClass( hideClass ); + $el.addClass( hideClass ).removeClass( outclass ); } this._visible = false; },