Transform $.bindReady into $.ready.promise. It is now possible to use $.ready.promise or $.when( $.ready ) to get the ready promise. Costs *1* byte min/gzipped. Unit test added.

This commit is contained in:
jaubourg
2012-05-06 01:05:03 +02:00
parent 714b8ffd2b
commit e3cf0e220c
3 changed files with 68 additions and 50 deletions

View File

@@ -2800,6 +2800,11 @@ test("fixHooks extensions", function() {
// which breaks order of execution on async loaded files
// also need PHP to make the incepted IFRAME hang
if ( hasPHP ) {
testIframeWithCallback( "jQuery.ready promise", "event/promiseReady", function( isOk ) {
expect(1);
ok( isOk, "$.when( $.ready ) works" );
});
testIframeWithCallback( "jQuery.ready synchronous load with long loading iframe", "event/syncReady", function( isOk ) {
expect(1);
ok( isOk, "jQuery loaded synchronously fires ready before all sub-resources are loaded" );