mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Selectmenu: improve element creation
This commit is contained in:
parent
1ba02e9c5f
commit
c9602857dd
6
ui/jquery.ui.selectmenu.js
vendored
6
ui/jquery.ui.selectmenu.js
vendored
@ -229,7 +229,7 @@ $.widget( "ui.selectmenu", {
|
|||||||
|
|
||||||
$.each( items, function( index, item ) {
|
$.each( items, function( index, item ) {
|
||||||
if ( item.optgroup !== currentOptgroup ) {
|
if ( item.optgroup !== currentOptgroup ) {
|
||||||
$( "<li />", {
|
$( "<li>", {
|
||||||
"class": "ui-selectmenu-optgroup" + ( item.element.parent( "optgroup" ).attr( "disabled" ) ? " ui-state-disabled" : "" ),
|
"class": "ui-selectmenu-optgroup" + ( item.element.parent( "optgroup" ).attr( "disabled" ) ? " ui-state-disabled" : "" ),
|
||||||
text: item.optgroup
|
text: item.optgroup
|
||||||
}).appendTo( ul );
|
}).appendTo( ul );
|
||||||
@ -240,8 +240,8 @@ $.widget( "ui.selectmenu", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_renderItem: function( ul, item ) {
|
_renderItem: function( ul, item ) {
|
||||||
var li = $( "<li />" ).data( "ui-selectmenu-item", item ),
|
var li = $( "<li>" ).data( "ui-selectmenu-item", item ),
|
||||||
a = $( "<a />", { href: "#" });
|
a = $( "<a>", { href: "#" });
|
||||||
|
|
||||||
if ( item.disabled ) {
|
if ( item.disabled ) {
|
||||||
li.addClass( "ui-state-disabled" );
|
li.addClass( "ui-state-disabled" );
|
||||||
|
Loading…
Reference in New Issue
Block a user