changed setTop logic so it works for abs or rel positioning for both headers and footers (rather than just footers)

This commit is contained in:
scottjehl 2010-10-05 15:36:10 -04:00
parent ab0e3324e9
commit 0de4e457be

View file

@ -88,16 +88,10 @@ $.fixedToolbars = (function(){
screenHeight = window.innerHeight,
thisHeight = el.outerHeight();
if( el.is('.ui-header-fixed') ){
return el.css('top', fromTop - thisTop + thisCSStop);
return el.css('top', (el.parents('.ui-page').length) ? fromTop - thisTop + thisCSStop : fromTop);
}
else{
//check if the footer is relative positioned or not
if( el.parents('.ui-page').length ){
return el.css('top', -1 * (thisTop - (fromTop + screenHeight) + thisCSStop + thisHeight) );
}
else{
return el.css('top', fromTop + screenHeight - thisHeight );
}
return el.css('top', (el.parents('.ui-page').length) ? -1 * (thisTop - (fromTop + screenHeight) + thisCSStop + thisHeight) : fromTop + screenHeight - thisHeight );
}
}