} );
asyncTest( "handle blur", function() {
- expect( 1 );
+ expect( 2 );
var blurHandled = false,
+ index = 1,
element = $( "#menu1" ).menu( {
- blur: function( event ) {
+ blur: function( event, ui ) {
// Ignore duplicate blur event fired by IE
if ( !blurHandled ) {
blurHandled = true;
equal( event.type, "menublur", "blur event.type is 'menublur'" );
+ strictEqual( ui.item[ 0 ], element.children()[ index ], "ui.item" );
}
}
} );
- click( element, "1" );
+ click( element, index );
setTimeout( function() {
element.trigger( "blur" );
setTimeout( function() {
} );
asyncTest( "handle blur via click outside", function() {
- expect( 1 );
+ expect( 2 );
var blurHandled = false,
+ index = 1,
element = $( "#menu1" ).menu( {
- blur: function( event ) {
+ blur: function( event, ui ) {
// Ignore duplicate blur event fired by IE
if ( !blurHandled ) {
blurHandled = true;
equal( event.type, "menublur", "blur event.type is 'menublur'" );
+ strictEqual( ui.item[ 0 ], element.children()[ index ], "ui.item" );
}
}
} );
- click( element, "1" );
+ click( element, index );
setTimeout( function() {
$( "<a>", { id: "remove" } ).appendTo( "body" ).trigger( "click" );
setTimeout( function() {
this._removeClass( this.active.children( ".ui-menu-item-wrapper" ),
null, "ui-state-active" );
- this.active = null;
this._trigger( "blur", event, { item: this.active } );
+ this.active = null;
},
_startOpening: function( submenu ) {