From deadbe67b239b0a526668adac4c2aa66e19aa55e Mon Sep 17 00:00:00 2001 From: scottjehl Date: Mon, 19 Dec 2011 21:15:45 +0700 Subject: [PATCH] changed scrollToggle to hideOnScrollStop, which does just that. It only works if tapToggle is true, so that once hidden, the bar can be toggled visible again with a tap. --- js/jquery.mobile.fixedToolbar.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/js/jquery.mobile.fixedToolbar.js b/js/jquery.mobile.fixedToolbar.js index 68b05d7b..d6ff8342 100644 --- a/js/jquery.mobile.fixedToolbar.js +++ b/js/jquery.mobile.fixedToolbar.js @@ -11,7 +11,7 @@ transition: "fade", //can be none, fade, slide (slide maps to slideup or slidedown) fullscreen: false, tapToggle: true, - scrollToggle: false, + hideOnScrollStop: true, // Browser detection! Weeee, here we go... // Unfortunately, position:fixed is costly, not to mention probably impossible, to feature-detect accurately. @@ -175,9 +175,7 @@ toggle: function(){ this[ this._visible ? "hide" : "show" ](); }, - - _visibleBeforeScroll: null, - + _bindToggleHandlers: function(){ var self = this, o = self.options, @@ -193,16 +191,12 @@ // scroll toggle $( window ) - .bind( "scrollstart", function(){ - if( o.scrollToggle && self.visible ){ - self.hide(); - } - }) .bind( "scrollstop", function(){ - if( o.scrollToggle && self._visibleBeforeScroll ){ + if( o.tapToggle && o.hideOnScrollStop ){ self.hide(); } }); + }, destroy: function(){