mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-05-05 13:14:45 +00:00
fixed init tests for ie
This commit is contained in:
parent
4bf8519cce
commit
7d3642f3ab
3 changed files with 20 additions and 19 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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(){
|
||||
|
|
|
|||
Loading…
Reference in a new issue