aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.menu.js
diff options
context:
space:
mode:
authorkborchers <kris.borchers@gmail.com>2012-05-24 23:44:51 -0500
committerkborchers <kris.borchers@gmail.com>2012-05-24 23:45:12 -0500
commitfe7ca1f1c3922a301169256ed0614c5529e40454 (patch)
tree815e4686d2821e80112c12feb62f3a51b198ea34 /ui/jquery.ui.menu.js
parentf63bb4fbc4899dacee2e55784bafc59b4a829954 (diff)
downloadjquery-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.js9
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" );