Selectmenu: Add links to all menu items to be in line with what menu expects and remove the extra space added to disabled items

This commit is contained in:
kborchers 2012-03-18 21:47:40 -05:00
parent e38feeacb6
commit 4a9e26c68e
2 changed files with 6 additions and 8 deletions

View File

@ -11,7 +11,6 @@
.ui-selectmenu-menu { padding: 0; margin: 0; position:absolute; top: 0; display: none; }
.ui-selectmenu-menu ul.ui-menu { overflow: auto; overflow-y: auto ; overflow-x: hidden; }
.ui-selectmenu-menu .ui-menu .ui-menu-item a { padding: 0.3em 1em 0.3em 1em; }
.ui-selectmenu-menu .ui-menu li.ui-state-disabled { padding: 0.3em 1em 0.3em 1em; }
.ui-selectmenu-menu .ui-menu li.ui-selectmenu-optgroup { font-weight: bold; line-height: 1.5; padding: 2px 0.4em; margin: 0.5em 0 0 0; }
.ui-selectmenu-open { display: block; }
.ui-selectmenu-button a.ui-button { display: inline-block; overflow: hidden; position: relative; text-decoration: none; }

View File

@ -258,14 +258,13 @@ $.widget( "ui.selectmenu", {
_renderItem: function( ul, item) {
var li = $( "<li />" ).data( "item.selectmenu", item );
if ( item.disabled ) {
li.addClass( 'ui-state-disabled' ).html( item.label );
} else {
li.addClass( 'ui-state-disabled' );
}
li.append( $( "<a />", {
html: item.label,
href: '#'
})
);
}
return li.appendTo( ul );
},