Skip to content

Commit 5e35a0c

Browse files
committed
Widget delegation: Put back the simple click event handler where it was.
1 parent 5b45d61 commit 5e35a0c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

ui/jquery.ui.menu.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,14 @@ $.widget( "ui.menu", {
3737
.attr({
3838
id: this.menuId,
3939
role: "menu"
40+
})
41+
// need to catch all clicks on disabled menu
42+
// not possible through _bind
43+
.bind("click.menu", function( event ) {
44+
if ( self.options.disabled ) {
45+
event.preventDefault();
46+
}
4047
});
41-
this.element.bind("click.menu", function( event ) {
42-
if ( self.options.disabled ) {
43-
event.preventDefault();
44-
}
45-
});
4648
this._bind({
4749
"click .ui-menu-item:has(a)": function( event ) {
4850
event.stopImmediatePropagation();

0 commit comments

Comments
 (0)