mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-04-24 08:04:43 +00:00
position loading message either center screen (if scrollTop supported), above active clicked button (if defined), or 100px off the top. Fixes #892
This commit is contained in:
parent
badefe1ee1
commit
2f9d1bce33
1 changed files with 10 additions and 3 deletions
|
|
@ -137,10 +137,17 @@
|
|||
$html.removeClass( "ui-loading" );
|
||||
} else {
|
||||
if( $.mobile.loadingMessage ){
|
||||
var activeLink = $( "." + $.mobile.activeBtnClass ).eq(0),
|
||||
yPos = activeLink.length ? activeLink.offset().top : $(window).scrollTop() + 75;
|
||||
$loader.appendTo($.mobile.pageContainer).css({top: yPos});
|
||||
var activeBtn =$( "." + $.mobile.activeBtnClass ).first();
|
||||
|
||||
$loader
|
||||
.appendTo( $.mobile.pageContainer )
|
||||
//position at y center (if scrollTop supported), above the activeBtn (if defined), or just 100px from top
|
||||
.css( {
|
||||
top: $.support.scrollTop && $(window).scrollTop() + $(window).height() / 2 ||
|
||||
activeBtn.length && activeBtn.offset().top || 100
|
||||
} );
|
||||
}
|
||||
|
||||
$html.addClass( "ui-loading" );
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue