Skip to content
Permalink
Browse files

Selectmenu: change to _bind (follow up), improved anchor handling

  • Loading branch information
fnagel committed Sep 30, 2011
1 parent 4039335 commit 4eff2a9cfa974692d3809ab8651dedcb1052f2a4
Showing with 11 additions and 5 deletions.
  1. +11 −5 ui/jquery.ui.selectmenu.js
@@ -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) {

0 comments on commit 4eff2a9

Please sign in to comment.
You can’t perform that action at this time.