From: Jörn Zaefferer Date: Thu, 28 Jul 2011 13:55:56 +0000 (+0200) Subject: Widget delegation: Put back the simple click event handler where it was. X-Git-Tag: 1.9m6~91^2~2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5e35a0c55b9dd7070cda7b5fb6fc1f031e04ae3e;p=jquery-ui.git Widget delegation: Put back the simple click event handler where it was. --- diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js index b8affd168..c2890502c 100644 --- a/ui/jquery.ui.menu.js +++ b/ui/jquery.ui.menu.js @@ -37,12 +37,14 @@ $.widget( "ui.menu", { .attr({ id: this.menuId, 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({ "click .ui-menu-item:has(a)": function( event ) { event.stopImmediatePropagation();