diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2011-07-28 15:55:56 +0200 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2011-07-28 15:55:56 +0200 |
commit | 5e35a0c55b9dd7070cda7b5fb6fc1f031e04ae3e (patch) | |
tree | 8b73507ac0b3656c77c2a266160e7748ec7b53b5 /ui/jquery.ui.menu.js | |
parent | 5b45d618dc208af58f968922fd799a7a8d8b1fac (diff) | |
download | jquery-ui-5e35a0c55b9dd7070cda7b5fb6fc1f031e04ae3e.tar.gz jquery-ui-5e35a0c55b9dd7070cda7b5fb6fc1f031e04ae3e.zip |
Widget delegation: Put back the simple click event handler where it was.
Diffstat (limited to 'ui/jquery.ui.menu.js')
-rw-r--r-- | ui/jquery.ui.menu.js | 12 |
1 files changed, 7 insertions, 5 deletions
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(); |