Fixed check for relative vs. absolute positioning of fixed toolbars. Now fullscreen toolbars will work as expected. Fixes #132

This commit is contained in:
scottjehl 2010-10-10 20:43:00 -04:00
parent 00d8f6b62d
commit f5ebfbcbd2

View file

@ -89,16 +89,17 @@ $.fixedToolbars = (function(){
thisCSStop = el.css('top') == 'auto' ? 0 : parseFloat(el.css('top')),
screenHeight = window.innerHeight,
thisHeight = el.outerHeight(),
useRelative = el.parents('.ui-page:not(.ui-page-fullscreen)').length,
relval;
if( el.is('.ui-header-fixed') ){
relval = fromTop - thisTop + thisCSStop;
if( relval < thisTop){ relval = 0; }
return el.css('top', (el.parents('.ui-page').length) ? relval : fromTop);
return el.css('top', ( useRelative ) ? relval : fromTop);
}
else{
relval = -1 * (thisTop - (fromTop + screenHeight) + thisCSStop + thisHeight);
if( relval > thisTop ){ relval = 0; }
return el.css('top', (el.parents('.ui-page').length) ? relval : fromTop + screenHeight - thisHeight );
return el.css('top', ( useRelative ) ? relval : fromTop + screenHeight - thisHeight );
}
}