From 5e35a0c55b9dd7070cda7b5fb6fc1f031e04ae3e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=CC=88rn=20Zaefferer?= Date: Thu, 28 Jul 2011 15:55:56 +0200 Subject: [PATCH] Widget delegation: Put back the simple click event handler where it was. --- ui/jquery.ui.menu.js | 12 +++++++----- 1 file 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(); -- 2.39.5