diff --git a/js/jquery.mobile.init.js b/js/jquery.mobile.init.js index ff8cb6d6..67d4fd98 100644 --- a/js/jquery.mobile.init.js +++ b/js/jquery.mobile.init.js @@ -123,9 +123,9 @@ // so if it's 1, use 0 from now on $.mobile.defaultHomeScroll = ( !$.support.scrollTop || $(window).scrollTop() === 1 ) ? 0 : 1; - // dom-ready inits - if ( $.mobile.autoInitializePage ) { - $( $.mobile.initializePage ); + //dom-ready inits + if( $.mobile.autoInitializePage ){ + $.mobile.initializePage(); } // window load event diff --git a/tests/functional/addrbar.html b/tests/functional/addrbar.html index 6e74c0b7..8007a1cc 100755 --- a/tests/functional/addrbar.html +++ b/tests/functional/addrbar.html @@ -11,13 +11,13 @@ diff --git a/tests/functional/gridlayout.html b/tests/functional/gridlayout.html index d4728eb0..908c2102 100644 --- a/tests/functional/gridlayout.html +++ b/tests/functional/gridlayout.html @@ -10,19 +10,19 @@ diff --git a/tests/unit/dialog/dialog_events.js b/tests/unit/dialog/dialog_events.js index bdde626a..0e53179f 100644 --- a/tests/unit/dialog/dialog_events.js +++ b/tests/unit/dialog/dialog_events.js @@ -1,24 +1,38 @@ /* * mobile dialog unit tests */ -(function($){ - module('jquery.mobile.dialog.js'); +(function($) { + module( "jquery.mobile.dialog.js" ); - asyncTest( "dialog hash is added when the dialog is opened and removed when closed", function(){ - expect( 2 ); + asyncTest( "dialog hash is added when the dialog is opened and removed when closed", function() { + expect( 6 ); - //bring up the dialog - $("a[href='#foo-dialog']").click(); + $.testHelper.pageSequence([ + function() { + //bring up the dialog + $( "#foo-dialog-link" ).click(); + }, - setTimeout(function(){ - ok(/&ui-state=dialog/.test(location.hash), "ui-state=dialog =~ location.hash"); - // close the dialog - $(".ui-dialog").dialog("close"); - }, 500); + function() { + var fooDialog = $( "#foo-dialog" ); - setTimeout(function(){ - ok(!/&ui-state=dialog/.test(location.hash), "ui-state=dialog !~ location.hash"); - start(); - }, 1000); + // make sure the dialog came up + ok( /&ui-state=dialog/.test(location.hash), "ui-state=dialog =~ location.hash", "dialog open" ); + + // Assert dialog theme inheritance (issue 1375): + ok( fooDialog.hasClass( "ui-body-b" ), "Expected explicit theme ui-body-b" ); + ok( fooDialog.find( ":jqmData(role=header)" ).hasClass( "ui-bar-a" ), "Expected header to inherit from $.mobile.page.prototype.options.headerTheme" ); + ok( fooDialog.find( ":jqmData(role=content)" ).hasClass( "ui-body-d" ), "Expect content to inherit from $.mobile.page.prototype.options.contentTheme" ); + ok( fooDialog.find( ":jqmData(role=footer)" ).hasClass( "ui-bar-a" ), "Expected footer to inherit from $.mobile.page.prototype.options.footerTheme" ); + + // close the dialog + $( ".ui-dialog" ).dialog( "close" ); + }, + + function() { + ok( !/&ui-state=dialog/.test(location.hash), "ui-state=dialog !~ location.hash" ); + start(); + } + ]); }); -})(jQuery); +})( jQuery ); diff --git a/tests/unit/dialog/index.html b/tests/unit/dialog/index.html index 7e3a82f2..8402d45b 100644 --- a/tests/unit/dialog/index.html +++ b/tests/unit/dialog/index.html @@ -6,6 +6,12 @@