From 0a2a82102ea8f418131cc28b39456dfd3393d223 Mon Sep 17 00:00:00 2001 From: Kin Blas Date: Fri, 24 Sep 2010 10:50:25 -0700 Subject: [PATCH] Fixed Issue 58 Fixed Headers/Footers Scroll with the document occassionally. The bug seems to be caused by the fact that code inside show() is triggering a scrollstart event while still in the midst of handling the scrollstop event. This threw off the setting of showAfterScroll causing the currentstate to be stuck at "inline", so no hide/show code is ever triggered after that. - Modified the scrollstart and sccrollstop callbacks to set showAfterScroll prior to calling show()/hide(). - movied the hide() call in scrollstart handler underneath the check for 'overlay'. --- js/jQuery.mobile.fixHeaderFooter.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/jQuery.mobile.fixHeaderFooter.js b/js/jQuery.mobile.fixHeaderFooter.js index 83b170b7..126a4afb 100644 --- a/js/jQuery.mobile.fixHeaderFooter.js +++ b/js/jQuery.mobile.fixHeaderFooter.js @@ -94,13 +94,13 @@ $.fixedToolbars = (function(){ .bind('scrollstart',function(){ if(currentstate == 'overlay'){ showAfterScroll = true; + $.fixedToolbars.hide(true); } - $.fixedToolbars.hide(true); }) .bind('scrollstop',function(){ if(showAfterScroll){ - $.fixedToolbars.show(); showAfterScroll = false; + $.fixedToolbars.show(); } }); }); @@ -182,4 +182,4 @@ $.fixedToolbars = (function(){ })(); -})(jQuery); \ No newline at end of file +})(jQuery);