Merge branch 'master' of github.com:jquery/jquery-mobile

This commit is contained in:
Todd Parker 2010-10-12 12:34:58 -04:00
commit f28223fb42
3 changed files with 21 additions and 30 deletions

View file

@ -7,7 +7,7 @@
</head>
<body>
<div data-role="page">
<div data-role="page" data-theme="a">
<div data-role="header" data-theme="d">
<h1>Dialog Example</h1>

View file

@ -28,12 +28,13 @@
.landscape body { }
/* "page" containers - full-screen views, one should always be in view post-pageload */
.ui-page { top: 0; left: 0; width: 100%; min-height: 100%; position: absolute; z-index: 10; visibility: hidden; height: 0; overflow: hidden; border: 0; }
.ui-page-active { visibility: visible; overflow: visible; }
.ui-page { top: 0; left: 0; width: 100%; min-height: 100%; position: absolute; z-index: 10; display: none; border: 0; }
.ui-page-active { display: block; overflow: visible; }
/* loading screen */
.ui-loading, .ui-loading body { overflow: hidden !important; }
.ui-loading .ui-loader { display: block; }
.ui-loading .ui-page { overflow: hidden; }
.ui-loader { display: none; position: absolute; opacity: .7; z-index: 10; top: 75px; left: 50%; width: 200px; margin-left: -130px; padding: 20px 30px; }
.ui-loader h1 { font-size: 15px; text-align: center; }
.ui-loader .ui-icon { position: static; display: block; opacity: .9; margin: 0 auto; width: 35px; height: 35px; background-color: transparent; }

View file

@ -84,34 +84,24 @@ $.fixedToolbars = (function(){
});
function setTop(el){
el.each(function(){
var el = $(this),
fromTop = $(window).scrollTop(),
thisTop = el.offset().top,
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', ( useRelative ) ? relval : fromTop);
}
else{
relval = -1 * (thisTop - (fromTop + screenHeight) + thisCSStop + thisHeight);
if( relval > thisTop ){ relval = 0; }
return el.css('top', ( useRelative ) ? relval : fromTop + screenHeight - thisHeight );
}
});
}
//timeout to work around current event issues.
setInterval(function(){
if( currentstate == 'overlay' ){
setTop($(toolbarSelector));
var fromTop = $(window).scrollTop(),
thisTop = el.offset().top,
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', ( useRelative ) ? relval : fromTop);
}
}, 50);
else{
relval = -1 * (thisTop - (fromTop + screenHeight) + thisCSStop + thisHeight);
if( relval > thisTop ){ relval = 0; }
return el.css('top', ( useRelative ) ? relval : fromTop + screenHeight - thisHeight );
}
}
//exposed methods
return {