Permalink
Browse files

Fixed 432 - Fullscreen positioning don't work iPhone/Android/Desktop

- $.mobile.activePage isn't being set till *AFTER* the "pageshow" notification, so pass in the page from our pageshow callback into the show() method.

- Also added missing getOffsetTop() call that I missed in my previous checkin.
  • Loading branch information...
1 parent e9d2c37 commit dfa1a689a4365cba80d4c27bed3a9ca618570d00 @jblas jblas committed Nov 11, 2010
Showing with 4 additions and 4 deletions.
  1. +4 −4 js/jquery.mobile.fixHeaderFooter.js
@@ -80,7 +80,7 @@ $.fixedToolbars = (function(){
if( stickyFooter && stickyFooter.length ){
stickyFooter.appendTo(event.target).css('top',0);
}
- $.fixedToolbars.show(true);
+ $.fixedToolbars.show(true, this);
});
});
@@ -137,13 +137,13 @@ $.fixedToolbars = (function(){
//exposed methods
return {
- show: function(immediately){
+ show: function(immediately, page){
currentstate = 'overlay';
- var $ap = $.mobile.activePage ? $.mobile.activePage : $(".ui-page-active");
+ var $ap = page ? $(page) : ($.mobile.activePage ? $.mobile.activePage : $(".ui-page-active"));
return $ap.children( toolbarSelector ).each(function(){
var el = $(this),
fromTop = $(window).scrollTop(),
- thisTop = el.offset().top,
+ thisTop = getOffsetTop(el[0]), // el.offset().top returns the wrong value on iPad iOS 3.2.1, call our workaround instead.
screenHeight = window.innerHeight,
thisHeight = el.outerHeight(),
alreadyVisible = (el.is('.ui-header-fixed') && fromTop <= thisTop + thisHeight) || (el.is('.ui-footer-fixed') && thisTop <= fromTop + screenHeight);

0 comments on commit dfa1a68

Please sign in to comment.