Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixedToolbar: change to binding to scrollStop with ._on to ensure bin…

…ding is destroyed. Also added comments.
  • Loading branch information...
commit 7d4b73f4e22a56cd5f88e449ef6e51a8f8d5e22f 1 parent 3f5a5bb
@arschmitz authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 js/widgets/fixedToolbar.js
View
9 js/widgets/fixedToolbar.js
@@ -256,11 +256,14 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
//trigger page redraw to fix incorrectly positioned fixed elements
$( "body" ).css( "padding-bottom", ( paddingBottom + 1 ) +"px" );
+ //if the padding is reset with out a timeout the reposition will not occure.
+ //this is independant of JQM the browser seems to need the time to react.
setTimeout( function() {
$( "body" ).css( "padding-bottom", paddingBottom + "px" );
//check if toolbar has been repositioned
if( self._viewportOffset() !== 0 ) {
- //reposition toolbars manually;
+ //reposition toolbars manually this seems to only be needed in iOS6 tore position when the keyboard is open
+ //but could serve as a general purpose fallback;
self._fixPosition();
}
}, 0 );
@@ -282,12 +285,12 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
var self = this,
viewportOffset = self._viewportOffset();
- $( window ).bind( "scrollstop", function() {
+ this._on( $( window ), { scrollstop: function() {
//check if the header is visible and if its in the right place
if( viewportOffset !== 0 && self._visible ) {
self._triggerRedraw();
}
- });
+ }});
},
Please sign in to comment.
Something went wrong with that request. Please try again.