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.
This commit is contained in:
Kin Blas 2010-11-11 13:39:54 -08:00
parent e9d2c376fc
commit dfa1a689a4

View file

@ -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);