Skip to content

Commit deadbe6

Browse files
author
scottjehl
committed
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.
1 parent 6aa3e38 commit deadbe6

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

js/jquery.mobile.fixedToolbar.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
transition: "fade", //can be none, fade, slide (slide maps to slideup or slidedown)
1212
fullscreen: false,
1313
tapToggle: true,
14-
scrollToggle: false,
14+
hideOnScrollStop: true,
1515

1616
// Browser detection! Weeee, here we go...
1717
// Unfortunately, position:fixed is costly, not to mention probably impossible, to feature-detect accurately.
@@ -175,9 +175,7 @@
175175
toggle: function(){
176176
this[ this._visible ? "hide" : "show" ]();
177177
},
178-
179-
_visibleBeforeScroll: null,
180-
178+
181179
_bindToggleHandlers: function(){
182180
var self = this,
183181
o = self.options,
@@ -193,16 +191,12 @@
193191

194192
// scroll toggle
195193
$( window )
196-
.bind( "scrollstart", function(){
197-
if( o.scrollToggle && self.visible ){
198-
self.hide();
199-
}
200-
})
201194
.bind( "scrollstop", function(){
202-
if( o.scrollToggle && self._visibleBeforeScroll ){
195+
if( o.tapToggle && o.hideOnScrollStop ){
203196
self.hide();
204197
}
205198
});
199+
206200
},
207201

208202
destroy: function(){

0 commit comments

Comments
 (0)