mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Widget delegation: Put back the simple click event handler where it was.
This commit is contained in:
parent
5b45d618dc
commit
5e35a0c55b
12
ui/jquery.ui.menu.js
vendored
12
ui/jquery.ui.menu.js
vendored
@ -37,12 +37,14 @@ $.widget( "ui.menu", {
|
|||||||
.attr({
|
.attr({
|
||||||
id: this.menuId,
|
id: this.menuId,
|
||||||
role: "menu"
|
role: "menu"
|
||||||
|
})
|
||||||
|
// need to catch all clicks on disabled menu
|
||||||
|
// not possible through _bind
|
||||||
|
.bind("click.menu", function( event ) {
|
||||||
|
if ( self.options.disabled ) {
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
this.element.bind("click.menu", function( event ) {
|
|
||||||
if ( self.options.disabled ) {
|
|
||||||
event.preventDefault();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this._bind({
|
this._bind({
|
||||||
"click .ui-menu-item:has(a)": function( event ) {
|
"click .ui-menu-item:has(a)": function( event ) {
|
||||||
event.stopImmediatePropagation();
|
event.stopImmediatePropagation();
|
||||||
|
Loading…
Reference in New Issue
Block a user