diff options
author | Felix Nagel <info@felixnagel.com> | 2012-01-27 00:06:02 +0100 |
---|---|---|
committer | Felix Nagel <info@felixnagel.com> | 2012-01-27 00:06:02 +0100 |
commit | bef7f1b15b1576c87faad1eb36458921c2443f30 (patch) | |
tree | 2c0c0f8ec69d4941b0288207dc07c5fbab71912a /ui | |
parent | 827a8cb35ccf0e7a1d5532887c7d5e8c6185df13 (diff) | |
download | jquery-ui-bef7f1b15b1576c87faad1eb36458921c2443f30.tar.gz jquery-ui-bef7f1b15b1576c87faad1eb36458921c2443f30.zip |
Selectmenu: click an optgroup header should not close the menu
Diffstat (limited to 'ui')
-rw-r--r-- | ui/jquery.ui.selectmenu.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index 6cb2c3014..46289677b 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -253,7 +253,13 @@ $.widget( "ui.selectmenu", { $.each( items, function( index, item ) { if ( item.optgroup != currentOptgroup ) { - var optgroup = $( '<li class="ui-selectmenu-optgroup">' + item.optgroup + '</li>' ); + var optgroup = $( '<li />', { + 'class': 'ui-selectmenu-optgroup', + html: item.optgroup, + click: function( event ){ + event.stopPropagation(); + } + }); if ( item.element.parent( "optgroup" ).attr( "disabled" ) ) optgroup.addClass( 'ui-state-disabled' ); ul.append( optgroup ); currentOptgroup = item.optgroup; |