mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Menu: Better disabled item handling using preventDefault() for the click event on anchors inside of disabled menu items and change the pointer to default
This commit is contained in:
parent
6de8030f01
commit
11b026d59b
1
themes/base/jquery.ui.menu.css
vendored
1
themes/base/jquery.ui.menu.css
vendored
@ -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; }
|
||||
|
3
ui/jquery.ui.menu.js
vendored
3
ui/jquery.ui.menu.js
vendored
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user