From 11b026d59b5d1f6f5cd55570c7148b2a33322c53 Mon Sep 17 00:00:00 2001 From: kborchers Date: Sun, 18 Mar 2012 21:18:00 -0500 Subject: [PATCH] Menu: Better disabled item handling using preventDefault() for the click event on anchors inside of disabled menu items and change the pointer to default --- themes/base/jquery.ui.menu.css | 1 + ui/jquery.ui.menu.js | 3 +++ 2 files changed, 4 insertions(+) diff --git a/themes/base/jquery.ui.menu.css b/themes/base/jquery.ui.menu.css index 84d7d85b1..1e559e661 100644 --- a/themes/base/jquery.ui.menu.css +++ b/themes/base/jquery.ui.menu.css @@ -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; } diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js index 18f4eb9f8..17177a906 100644 --- a/ui/jquery.ui.menu.js +++ b/ui/jquery.ui.menu.js @@ -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 -- 2.39.5