aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorFelix Nagel <info@felixnagel.com>2011-09-30 21:36:16 +0200
committerFelix Nagel <info@felixnagel.com>2011-09-30 21:36:16 +0200
commit4eff2a9cfa974692d3809ab8651dedcb1052f2a4 (patch)
tree47fdbf3d5a27cbfa9acc153d6a26b2b201562726 /ui
parent40393353bb5866cb4bf3ae4069066dfb76596e7c (diff)
downloadjquery-ui-4eff2a9cfa974692d3809ab8651dedcb1052f2a4.tar.gz
jquery-ui-4eff2a9cfa974692d3809ab8651dedcb1052f2a4.zip
Selectmenu: change to _bind (follow up), improved anchor handling
Diffstat (limited to 'ui')
-rw-r--r--ui/jquery.ui.selectmenu.js16
1 files changed, 11 insertions, 5 deletions
diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js
index 79c3c1435..1aea9da01 100644
--- a/ui/jquery.ui.selectmenu.js
+++ b/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) {