]> source.dussan.org Git - jquery-ui.git/commitdiff
Selectmenu: remove link element and adjust styles in custom renderer demo
authorFelix Nagel <info@felixnagel.com>
Mon, 25 Nov 2013 23:32:27 +0000 (00:32 +0100)
committerFelix Nagel <info@felixnagel.com>
Mon, 25 Nov 2013 23:32:27 +0000 (00:32 +0100)
demos/selectmenu/custom_render.html

index b037d325a1cbe80f1823fe4756b0620c442efb18..fb8127bbd7a9229ddad73be1012778a5195f1a58 100644 (file)
        $(function() {
                $.widget( "custom.iconselectmenu", $.ui.selectmenu, {
                        _renderItem: function( ul, item ) {
-                               var a, span,
-                                       li = $( "<li>" );
+                               var li = $( "<li>", { text: item.label } );
 
                                if ( item.disabled ) {
                                        li.addClass( "ui-state-disabled" ).text( item.label );
                                } else {
-                                       a = $( "<a>", {
-                                               text: item.label,
-                                               href: "#"
-                                       }).appendTo( li );
-                                       span = $( "<span>", {
+                                       $( "<span>", {
                                                style: item.element.attr( "style" ),
                                                "class": "ui-icon " + item.element.attr( "class" )
-                                       }).appendTo( a );
+                                       }).appendTo( li );
                                }
 
                                return li.appendTo( ul );
                        width: 200px;
                }
 
-               .ui-selectmenu-menu .ui-menu .ui-icon {
-                       top: 0.4em;
-               }
                .ui-selectmenu-menu .ui-menu .ui-menu-item a {
                        padding-left: 2em;
                }
 
                /* select with custom icons */
-               .ui-selectmenu-menu .ui-menu.customicons .ui-menu-item {
+               .ui-selectmenu-menu .ui-menu.customicons .ui-menu-item {
                        padding: 0.5em 0 0.5em 3em;
                }
-               .ui-selectmenu-menu .ui-menu.customicons .ui-menu-item .ui-icon {
+               .ui-selectmenu-menu .ui-menu.customicons .ui-menu-item .ui-icon {
                        height: 24px;
                        width: 24px;
-                       top: 0.2em;
+                       top: 0.1em;
                }
                .ui-icon.video {
                        background: url(images/24-video-square.png) 0 0 no-repeat;