Widget delegation: Put back the simple click event handler where it was.

This commit is contained in:
Jörn Zaefferer 2011-07-28 15:55:56 +02:00
parent 5b45d618dc
commit 5e35a0c55b

12
ui/jquery.ui.menu.js vendored
View File

@ -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();