Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Suggestion: Fix for fixed persistent toolbar padding issues #4260

Merged
merged 3 commits into from Jun 15, 2012
@@ -130,15 +130,17 @@ define( [ "jquery", "./jquery.mobile.widget", "./jquery.mobile.core", "./jquery.
}
} )
.bind( "webkitAnimationStart animationstart updatelayout", function(){
+ var thisPage = this;
if( o.updatePagePadding ){
- self.updatePagePadding();
+ self.updatePagePadding( thisPage );
}
})
.bind( "pageshow", function(){
- self.updatePagePadding();
+ var thisPage = this;
if( o.updatePagePadding ){
+ self.updatePagePadding( thisPage );
$( window ).bind( "throttledresize." + self.widgetName, function(){
- self.updatePagePadding();
+ self.updatePagePadding( thisPage );
});
}
})
@@ -173,14 +175,15 @@ define( [ "jquery", "./jquery.mobile.widget", "./jquery.mobile.core", "./jquery.
_visible: true,
// This will set the content element's top or bottom padding equal to the toolbar's height
- updatePagePadding: function() {
+ updatePagePadding: function( tbPage ) {
var $el = this.element,
header = $el.is( ".ui-header" );
@gseguin

gseguin May 2, 2012

Member

I would add: tbPage = tbPage || $el.closest( ".ui-page" ) what do you think?

@MauriceG

MauriceG May 3, 2012

Contributor

Hi @gseguin !
Thanks a lot for looking at this!

// This behavior only applies to "fixed", not "fullscreen"
if( this.options.fullscreen ){ return; }
- $el.closest( ".ui-page" ).css( "padding-" + ( header ? "top" : "bottom" ), $el.outerHeight() );
+ tbPage = tbPage || $el.closest( ".ui-page" );
+ $(tbPage).css( "padding-" + ( header ? "top" : "bottom" ), $el.outerHeight() );
},
_useTransition: function( notransition ){