From bb17f146e47b0f48990fa014b3add8e8ceeb01a3 Mon Sep 17 00:00:00 2001 From: scottjehl Date: Thu, 26 Jan 2012 16:06:44 +0700 Subject: [PATCH] added an argument to the show and hide methods to specify that no transition should be used, regardless of the default transition type. This is now used on pageshow, so the toolbar does not use an animated transition when the page is initially shown. --- js/jquery.mobile.fixedToolbar.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/js/jquery.mobile.fixedToolbar.js b/js/jquery.mobile.fixedToolbar.js index 74bed8e6..21fd593f 100644 --- a/js/jquery.mobile.fixedToolbar.js +++ b/js/jquery.mobile.fixedToolbar.js @@ -119,7 +119,7 @@ define( [ "jquery", "./jquery.mobile.widget", "./jquery.mobile.core", "./jquery. $.mobile.zoom.disable( true ); } if( o.visibleOnPageShow ){ - self.show(); + self.show( true ); } } ) .bind( "webkitAnimationStart animationstart", function(){ @@ -158,7 +158,7 @@ define( [ "jquery", "./jquery.mobile.widget", "./jquery.mobile.core", "./jquery. $el.closest( ".ui-page" ).css( "padding-" + ( header ? "top" : "bottom" ), $el.height() ); }, - show: function(){ + show: function( notransition ){ var hideClass = "ui-fixed-hidden", $el = this.element, $win = $( window ), @@ -168,7 +168,7 @@ define( [ "jquery", "./jquery.mobile.widget", "./jquery.mobile.core", "./jquery. viewportHeight = Math.min( screen.height, $win.height() ), tbtype = $el.is( ".ui-header" ) ? "header" : "footer"; - if( this.options.transition && this.options.transition !== "none" && + if( !notransition && this.options.transition && this.options.transition !== "none" && ( ( tbtype === "header" && !this.options.fullscreen && scroll > elHeight ) || ( tbtype === "footer" && !this.options.fullscreen && scroll + viewportHeight < pHeight - elHeight ) @@ -183,7 +183,7 @@ define( [ "jquery", "./jquery.mobile.widget", "./jquery.mobile.core", "./jquery. this._visible = true; }, - hide: function(){ + hide: function( notransition ){ var hideClass = "ui-fixed-hidden", $el = this.element, $win = $( window ), @@ -195,7 +195,7 @@ define( [ "jquery", "./jquery.mobile.widget", "./jquery.mobile.core", "./jquery. // 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( !notransition && this.options.transition && this.options.transition !== "none" && ( ( tbtype === "header" && !this.options.fullscreen && scroll > elHeight ) || ( tbtype === "footer" && !this.options.fullscreen && scroll + viewportHeight < pHeight - elHeight )