mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-05-20 04:11:52 +00:00
Fixed check for relative vs. absolute positioning of fixed toolbars. Now fullscreen toolbars will work as expected. Fixes #132
This commit is contained in:
parent
00d8f6b62d
commit
f5ebfbcbd2
1 changed files with 3 additions and 2 deletions
|
|
@ -89,16 +89,17 @@ $.fixedToolbars = (function(){
|
||||||
thisCSStop = el.css('top') == 'auto' ? 0 : parseFloat(el.css('top')),
|
thisCSStop = el.css('top') == 'auto' ? 0 : parseFloat(el.css('top')),
|
||||||
screenHeight = window.innerHeight,
|
screenHeight = window.innerHeight,
|
||||||
thisHeight = el.outerHeight(),
|
thisHeight = el.outerHeight(),
|
||||||
|
useRelative = el.parents('.ui-page:not(.ui-page-fullscreen)').length,
|
||||||
relval;
|
relval;
|
||||||
if( el.is('.ui-header-fixed') ){
|
if( el.is('.ui-header-fixed') ){
|
||||||
relval = fromTop - thisTop + thisCSStop;
|
relval = fromTop - thisTop + thisCSStop;
|
||||||
if( relval < thisTop){ relval = 0; }
|
if( relval < thisTop){ relval = 0; }
|
||||||
return el.css('top', (el.parents('.ui-page').length) ? relval : fromTop);
|
return el.css('top', ( useRelative ) ? relval : fromTop);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
relval = -1 * (thisTop - (fromTop + screenHeight) + thisCSStop + thisHeight);
|
relval = -1 * (thisTop - (fromTop + screenHeight) + thisCSStop + thisHeight);
|
||||||
if( relval > thisTop ){ relval = 0; }
|
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 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue