mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Selectmenu: improved event handling, fixed anchor problem when clicking menu item
This commit is contained in:
parent
2be6e70bba
commit
ee26baa997
9
ui/jquery.ui.selectmenu.js
vendored
9
ui/jquery.ui.selectmenu.js
vendored
@ -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 ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user