]> source.dussan.org Git - jquery-ui.git/commitdiff
Widget delegation: Put back the simple click event handler where it was.
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Thu, 28 Jul 2011 13:55:56 +0000 (15:55 +0200)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Thu, 28 Jul 2011 13:55:56 +0000 (15:55 +0200)
ui/jquery.ui.menu.js

index b8affd16838fcc3dab18dd47e866085fd54d1296..c2890502ce9899d07340d24a0fc29d8434020fc8 100644 (file)
@@ -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();