mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Selectmenu: change to _bind (follow up), improved anchor handling
This commit is contained in:
parent
40393353bb
commit
4eff2a9cfa
16
ui/jquery.ui.selectmenu.js
vendored
16
ui/jquery.ui.selectmenu.js
vendored
@ -137,6 +137,10 @@ $.widget( "ui.selectmenu", {
|
||||
}
|
||||
|
||||
that._bind( that.list, {
|
||||
'click': function( event ) {
|
||||
event.preventDefault();
|
||||
},
|
||||
// namespacing is needed (_bind should do the trick, but it doesnt)
|
||||
'mouseenter.selectmenu': function() {
|
||||
that.hover = true;
|
||||
},
|
||||
@ -292,10 +296,11 @@ $.widget( "ui.selectmenu", {
|
||||
} else {
|
||||
li.append( $( "<a />", {
|
||||
text: item.label,
|
||||
href: '#',
|
||||
click: function( event ) {
|
||||
event.preventDefault();
|
||||
}
|
||||
href: '#'
|
||||
,
|
||||
// click: function( event ) {
|
||||
// event.preventDefault();
|
||||
// }
|
||||
})
|
||||
);
|
||||
}
|
||||
@ -333,7 +338,8 @@ $.widget( "ui.selectmenu", {
|
||||
event.stopImmediatePropagation();
|
||||
},
|
||||
click: function( event ) {
|
||||
event.stopImmediatePropagation();
|
||||
// needed to prevent browser from following the anchor
|
||||
return false;
|
||||
},
|
||||
keydown: function( event ) {
|
||||
switch (event.keyCode) {
|
||||
|
Loading…
Reference in New Issue
Block a user