mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Selectmenu; improve HTML building in custom render demo
This commit is contained in:
parent
7715c71a9f
commit
255d4f6d0a
@ -15,23 +15,20 @@
|
||||
$(function() {
|
||||
$.widget( "custom.iconselectmenu", $.ui.selectmenu, {
|
||||
_renderItem: function( ul, item ) {
|
||||
var element, span,
|
||||
var a, span,
|
||||
li = $( "<li>" );
|
||||
|
||||
if ( item.disabled ) {
|
||||
li.addClass( "ui-state-disabled" ).text( item.label );
|
||||
} else {
|
||||
element = item.element;
|
||||
a = $( "<a>", {
|
||||
text: item.label,
|
||||
href: "#"
|
||||
}).appendTo( li );
|
||||
span = $( "<span>", {
|
||||
style: element.attr( "style" ),
|
||||
"class": "ui-icon " + element.attr( "class" )
|
||||
});
|
||||
$( "<a>", {
|
||||
text: item.label,
|
||||
href: "#"
|
||||
})
|
||||
.append( span )
|
||||
.appendTo( li );
|
||||
style: item.element.attr( "style" ),
|
||||
"class": "ui-icon " + item.element.attr( "class" )
|
||||
}).appendTo( a );
|
||||
}
|
||||
|
||||
return li.appendTo( ul );
|
||||
|
Loading…
Reference in New Issue
Block a user