Skip to content
Permalink
Browse files

Menu: Better disabled item handling using preventDefault() for the cl…

…ick event on anchors inside of disabled menu items and change the pointer to default
  • Loading branch information...
kborchers committed Mar 19, 2012
1 parent 6de8030 commit 11b026d59b5d1f6f5cd55570c7148b2a33322c53
Showing with 4 additions and 0 deletions.
  1. +1 −0 themes/base/jquery.ui.menu.css
  2. +3 −0 ui/jquery.ui.menu.js
@@ -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; }
@@ -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

0 comments on commit 11b026d

Please sign in to comment.
You can’t perform that action at this time.