Skip to content
Browse files

check prototype settings

  • Loading branch information...
1 parent 93cd48c commit 5ee7b0f4dbab2f3045e5d52b9174c7f0b4a4869d @johnbender johnbender committed May 10, 2012
Showing with 13 additions and 16 deletions.
  1. +1 −2 js/jquery.mobile.loader.js
  2. +2 −3 tests/unit/init/index.html
  3. +10 −11 tests/unit/init/init_core.js
View
3 js/jquery.mobile.loader.js
@@ -106,8 +106,7 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.init" ], function(
if( $.type(theme) == "object" ){
loadSettings = $.extend({}, this.options, theme);
- // prefer object property from the param or the $.mobile.loading object
- // then the old theme setting
+ // prefer object property from the param then the old theme setting
theme = loadSettings.theme || $.mobile.loadingMessageTheme;
} else {
loadSettings = this.options;
View
5 tests/unit/init/index.html
@@ -6,14 +6,13 @@
<!-- meta viewport left out on purpose for test append -->
<script src="../../../js/jquery.tag.inserter.js"></script>
<script src="../jquery.setNameSpace.js"></script>
- <script src="../../../js/"></script>
<script src="../../../external/qunit.js"></script>
<script src="../../jquery.testHelper.js"></script>
<script src="init_core.js"></script>
<!-- added explicitly for library reloading (see testHelper ) -->
- <script src="../../../js/jquery.mobile.core.js"></script>
+ <script src="../../../js/"></script>
<script src="../../../js/jquery.mobile.init.js"></script>
- <script src="../../../js/jquery.mobile.loader.js"></script>
+ <script src="../../../js/jquery.mobile.core.js"></script>
<link rel="stylesheet" href="../../../css/themes/default/jquery.mobile.css" />
<link rel="stylesheet" href="../../../external/qunit.css"/>
View
21 tests/unit/init/init_core.js
@@ -19,7 +19,7 @@
// NOTE reset for gradeA tests
$('html').removeClass('ui-mobile');
- $.mobile.loaderWidget.loader( 'hide' );
+ $.mobile.loading( 'hide' );
},
teardown: function(){
@@ -36,10 +36,11 @@
// NOTE important to use $.fn.one here to make sure library reloads don't fire
// the event before the test check below
- $(document).one("mobileinit", function(){
+ $(document).one( "mobileinit", function(){
mobilePage = $.mobile.page;
- $.mobile.loadingMessage = false;
+ $.mobile.loader.prototype.options.text = "mobileinit";
+ $.mobile.loader.prototype.options.textVisible = true;
});
// NOTE for the following two tests see index html for the binding
@@ -148,6 +149,12 @@
same($("#bar").jqmData('url'), "bak");
});
+ test( "prototype options are used for mobile loader", function() {
+ $.mobile.loading( 'show' );
+
+ same( $('.ui-loader').text(), "mobileinit", "prototype options work" );
+ });
+
test( "showPageLoadingMsg does not show the text when the loading message is false", function(){
$.mobile.loadingMessage = false;
$.mobile.showPageLoadingMsg();
@@ -177,13 +184,6 @@
same($(".ui-loading").length, 1, "page should be in the loading state");
});
- test( "page loading should contain default loading message", function(){
- reloadCoreNSandInit();
- $.mobile.showPageLoadingMsg();
-
- same($(".ui-loader h1").text(), "loading");
- });
-
test( "page loading should contain custom loading message", function(){
$.mobile.loadingMessage = "foo";
$.testHelper.reloadLib(libName);
@@ -199,7 +199,6 @@
same($(".ui-loader h1").text(), "bar");
});
-
test( "page loading should contain custom loading message when used in param object", function() {
$.mobile.showPageLoadingMsg({ text: "bak" });
same($(".ui-loader h1").text(), "bak", "loader has custom message 'bak'");

0 comments on commit 5ee7b0f

Please sign in to comment.
Something went wrong with that request. Please try again.