Selectmenu: improved event handling, fixed anchor problem when clicking menu item

This commit is contained in:
Felix Nagel 2011-10-10 20:27:29 +02:00
parent 2be6e70bba
commit ee26baa997

View File

@ -144,7 +144,10 @@ $.widget( "ui.selectmenu", {
if ( flag ) that._trigger( "change", event, { item: item } ); if ( flag ) that._trigger( "change", event, { item: item } );
if ( that.opened ) {
event.preventDefault();
that.close( event, true); that.close( event, true);
}
}, },
focus: function( event, ui ) { focus: function( event, ui ) {
var item = ui.item.data( "item.selectmenu" ); var item = ui.item.data( "item.selectmenu" );
@ -153,12 +156,6 @@ $.widget( "ui.selectmenu", {
} }
}); });
that._bind( that.list, {
'click': function( event ) {
event.preventDefault();
}
});
// document click closes menu // document click closes menu
that._bind( document, { that._bind( document, {
'mousedown': function( event ) { 'mousedown': function( event ) {