mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-16 22:10:25 +00:00
This commit is contained in:
parent
12d52772cb
commit
6da7e4a1dc
2 changed files with 15 additions and 1 deletions
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
//loading div which appears during Ajax requests
|
||||
//will not appear if $.mobile.loadingMessage is false
|
||||
var $loader = $.mobile.loadingMessage ? $( "<div class='ui-loader ui-body-a ui-corner-all'>" + "<span class='ui-icon ui-icon-loading spin'></span>" + "<h1>" + $.mobile.loadingMessage + "</h1>" + "</div>" ) : undefined;
|
||||
var $loader = $( "<div class='ui-loader ui-body-a ui-corner-all'><span class='ui-icon ui-icon-loading spin'></span><h1></h1></div>" );
|
||||
|
||||
$.extend($.mobile, {
|
||||
// turn on/off page loading message.
|
||||
|
|
@ -42,6 +42,9 @@
|
|||
var activeBtn = $( "." + $.mobile.activeBtnClass ).first();
|
||||
|
||||
$loader
|
||||
.find( "h1" )
|
||||
.text( $.mobile.loadingMessage )
|
||||
.end()
|
||||
.appendTo( $.mobile.pageContainer )
|
||||
//position at y center (if scrollTop supported), above the activeBtn (if defined), or just 100px from top
|
||||
.css( {
|
||||
|
|
|
|||
|
|
@ -201,5 +201,16 @@
|
|||
start();
|
||||
}, 500);
|
||||
});
|
||||
|
||||
asyncTest( "page loading should contain custom loading message when set during runtime", function(){
|
||||
$.mobile.loadingMessage = "bar";
|
||||
$.mobile.pageLoading(false);
|
||||
|
||||
setTimeout(function(){
|
||||
same($(".ui-loader h1").text(), "bar");
|
||||
start();
|
||||
}, 500);
|
||||
});
|
||||
|
||||
});
|
||||
})(jQuery);
|
||||
|
|
|
|||
Loading…
Reference in a new issue