Fixed 59 - Fixed footer is anchored to the end of the page content instead of the view port.

- If content is less than the view port height, the footer is always anchored at the bottom of the view port.
- If the content is greater in height than the view port, then in inline mode itrests in flow, and in "fixed" mode it snaps to the bottom of the view port.
This commit is contained in:
Kin Blas 2010-11-11 16:08:45 -08:00
parent 058f0a867d
commit a77ca291e6

View file

@ -130,7 +130,7 @@ $.fixedToolbars = (function(){
else{
//relval = -1 * (thisTop - (fromTop + screenHeight) + thisCSStop + thisHeight);
//if( relval > thisTop ){ relval = 0; }
relval = fromTop + screenHeight - thisHeight - thisTop;
relval = fromTop + screenHeight - thisHeight - (thisTop - thisCSStop);
return el.css('top', ( useRelative ) ? relval : fromTop + screenHeight - thisHeight );
}
}
@ -164,20 +164,25 @@ $.fixedToolbars = (function(){
var $ap = $.mobile.activePage ? $.mobile.activePage : $(".ui-page-active");
return $ap.children( toolbarSelector ).each(function(){
var el = $(this);
var thisCSStop = el.css('top'); thisCSStop = thisCSStop == 'auto' ? 0 : parseFloat(thisCSStop);
//add state class
el.addClass('ui-fixed-inline').removeClass('ui-fixed-overlay');
if(immediately){
el.css('top',0);
}
else{
if( el.css('top') !== 'auto' && parseFloat(el.css('top')) !== 0 ){
var classes = 'out reverse';
el.addClass(classes).animationComplete(function(){
el.removeClass(classes);
el.css('top',0);
});
if (thisCSStop < 0 || (el.is('.ui-header-fixed') && thisCSStop != 0))
{
if(immediately){
el.css('top',0);
}
else{
if( el.css('top') !== 'auto' && parseFloat(el.css('top')) !== 0 ){
var classes = 'out reverse';
el.addClass(classes).animationComplete(function(){
el.removeClass(classes);
el.css('top',0);
});
}
}
}
});