]> source.dussan.org Git - jquery-ui.git/commitdiff
Menu: Better disabled item handling using preventDefault() for the click event on...
authorkborchers <kris.borchers@gmail.com>
Mon, 19 Mar 2012 02:18:00 +0000 (21:18 -0500)
committerkborchers <kris.borchers@gmail.com>
Mon, 19 Mar 2012 02:18:00 +0000 (21:18 -0500)
themes/base/jquery.ui.menu.css
ui/jquery.ui.menu.js

index 84d7d85b16d13c9c888cfbcfb69412391f973811..1e559e6613265355bfeb9c30b930a9dcab306741 100644 (file)
@@ -15,6 +15,7 @@
 .ui-menu .ui-menu-item a.ui-state-active { font-weight: normal; margin: -1px; }
 
 .ui-menu .ui-state-disabled { font-weight: normal; margin: .4em 0 .2em; line-height: 1.5; }
+.ui-menu .ui-state-disabled a { cursor: default; }
 
 /* icon support */
 .ui-menu-icons { position: relative; }
index 18f4eb9f8e8a90bc2e4c52c02cd89200f78cae47..17177a906359e1da74679d744707755c80a9902c 100644 (file)
@@ -59,6 +59,9 @@ $.widget( "ui.menu", {
                        "mousedown .ui-menu-item > a": function( event ) {
                                event.preventDefault();
                        },
+                       "click .ui-state-disabled > a": function( event ) {
+                               event.preventDefault();
+                       },
                        "click .ui-menu-item:has(a)": function( event ) {
                                event.stopImmediatePropagation();
                                //Don't select disabled menu items