var ready = assert.async( 3 );
assert.expect( 1 );
+ var jQuery1Dot8 = jQuery.fn.jquery.indexOf( "1.8" ) === 0;
+
var element = $( "<div>" ).dialog( {
autoOpen: false,
modal: true,
// handle a call to the open() method during the process of the dialog
// being opened.
.on( "blur", function() {
+
+ // Support: jQuery 1.8 only
+ // The test never fully worked in jQuery 1.8 since the input's blur
+ // handler never fired. It's only been uncovered when `ready()` calls
+ // have been added to all handlers. Skip this handler in jQuery 1.8.
+ if ( jQuery1Dot8 ) {
+ return;
+ }
+
element.dialog( "open" );
// Detach the handlers to avoid firing them outside of this
ready();
} )
.trigger( "focus" );
+
+ // Support: jQuery 1.8 only
+ // Account for the skipped `ready()` call above. To make sure the count
+ // is constant, call it here instead.
+ if ( jQuery1Dot8 ) {
+ ready();
+ }
} );
QUnit.test( "#5531: dialog width should be at least minWidth on creation", function( assert ) {