Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Made loading message configurable at runtime. Fixes #2044. Fixes #1974.…

… Fixes #1947.
  • Loading branch information...
commit 6da7e4a1dc7b0b54fae3357d300f663ed3dc94cd 1 parent 12d5277
scottjehl authored
Showing with 15 additions and 1 deletion.
  1. +4 −1 js/jquery.mobile.init.js
  2. +11 −0 tests/unit/init/init_core.js
5 js/jquery.mobile.init.js
View
@@ -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( {
11 tests/unit/init/init_core.js
View
@@ -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);
Please sign in to comment.
Something went wrong with that request. Please try again.