diff options
author | kborchers <kris.borchers@gmail.com> | 2012-05-24 23:44:51 -0500 |
---|---|---|
committer | kborchers <kris.borchers@gmail.com> | 2012-05-24 23:45:12 -0500 |
commit | fe7ca1f1c3922a301169256ed0614c5529e40454 (patch) | |
tree | 815e4686d2821e80112c12feb62f3a51b198ea34 /ui/jquery.ui.menu.js | |
parent | f63bb4fbc4899dacee2e55784bafc59b4a829954 (diff) | |
download | jquery-ui-fe7ca1f1c3922a301169256ed0614c5529e40454.tar.gz jquery-ui-fe7ca1f1c3922a301169256ed0614c5529e40454.zip |
Menu: Better handling of divider elements and menu items without anchors.
Diffstat (limited to 'ui/jquery.ui.menu.js')
-rw-r--r-- | ui/jquery.ui.menu.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js index e6a047e53..5a3afdaaf 100644 --- a/ui/jquery.ui.menu.js +++ b/ui/jquery.ui.menu.js @@ -299,8 +299,13 @@ $.widget( "ui.menu", { } }); - // initialize unlinked menu-items as dividers - menus.children( ":not(.ui-menu-item)" ).addClass( "ui-widget-content ui-menu-divider" ); + // initialize unlinked menu-items containing spaces and/or dashes only as dividers + menus.children( ":not(.ui-menu-item)" ).each( function() { + var item = $( this ); + if ( !/[^\-—–\s]/.test( item.text() ) ) { + item.addClass( "ui-widget-content ui-menu-divider" ); + } + }); // add aria-disabled attribute to any disabled menu item menus.children( ".ui-state-disabled" ).attr( "aria-disabled", "true" ); |