fixed init tests for ie

This commit is contained in:
John Bender 2011-03-24 09:46:13 -07:00
parent 4bf8519cce
commit 7d3642f3ab
3 changed files with 20 additions and 19 deletions

View file

@ -32,13 +32,11 @@
//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 = $.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;
if(typeof $loader === "undefined"){
alert($.mobile.loadingMessage);
}
$.extend($.mobile, {
// turn on/off page loading message.
@ -49,6 +47,11 @@
if( $.mobile.loadingMessage ){
var activeBtn = $( "." + $.mobile.activeBtnClass ).first();
if(typeof $loader === "undefined"){
alert($.mobile.loadingMessage);
}
$loader
.appendTo( $.mobile.pageContainer )
//position at y center (if scrollTop supported), above the activeBtn (if defined), or just 100px from top

View file

@ -122,7 +122,6 @@
$($.event.special.scrollstart).trigger("touchmove");
setTimeout(function(){
console.log('huh?');
ok(triggered, "triggered");
start();
}, 50);
@ -196,7 +195,6 @@
expect( 1 );
var tap = false,
checkTap = function(){
console.log('hur?');
ok(true, "tap fired");
};

View file

@ -109,23 +109,26 @@
};
test( "active page and start page should be set to the fist page in the selected set", function(){
var firstPage = findFirstPage();
expect( 2 );
$.testHelper.reloadLib(libName);
var firstPage = findFirstPage();
same($.mobile.firstPage, firstPage);
same($.mobile.activePage, firstPage);
});
test( "mobile viewport class is defined on the first page's parent", function(){
var firstPage = findFirstPage();
expect( 1 );
$.testHelper.reloadLib(libName);
var firstPage = findFirstPage();
ok(firstPage.parent().hasClass('ui-mobile-viewport'));
});
test( "mobile page container is the first page's parent", function(){
var firstPage = findFirstPage();
expect( 1 );
$.testHelper.reloadLib(libName);
var firstPage = findFirstPage();
same($.mobile.pageContainer, firstPage.parent());
});
@ -159,8 +162,7 @@
});
asyncTest( "pageLoading doesn't add the dialog to the page when loading message is false", function(){
$.testHelper.alterExtend({loadingMessage: false});
$.testHelper.reloadLib(libName);
$.mobile.loadingMessage = false;
$.mobile.pageLoading(false);
setTimeout(function(){
@ -169,9 +171,8 @@
}, 500);
});
asyncTest( "pageLoading removes the loading class from the page when done is passed as true", function(){
$.testHelper.alterExtend({loadingMessage: true});
$.testHelper.reloadLib(libName);
asyncTest( "pageLoading doesn't add the dialog to the page when done is passed as true", function(){
$.mobile.loadingMessage = true;
$.mobile.pageLoading(true);
setTimeout(function(){
@ -180,9 +181,8 @@
}, 500);
});
asyncTest( "pageLoading adds the loading class to the page when done is false", function(){
$.testHelper.alterExtend({loadingMessage: true});
reloadCoreNSandInit();
asyncTest( "pageLoading adds the dialog to the page when done is true", function(){
$.mobile.loadingMessage = true;
$.mobile.pageLoading(false);
setTimeout(function(){