r2728 - rewrote the way the "icon" property is being made optional for more convenient syntax.

r2728 - rewrote the way the "icon" property is being made optional for more convenient syntax.


Author: scottjehl
Date: Fri Jun 12 09:58:00 2009
New Revision: 2728
Modified:
branches/labs/selectmenu/ui.selectmenu.js
Log:
rewrote the way the "icon" property is being made optional for more
convenient syntax.
Modified: branches/labs/selectmenu/ui.selectmenu.js
==============================================================================
--- branches/labs/selectmenu/ui.selectmenu.js    (original)
+++ branches/labs/selectmenu/ui.selectmenu.js    Fri Jun 12 09:58:00 2009
@@ -126,11 +126,11 @@
                            thisLi
                                .data('optionClasses', s_options[i].classes + '
ui-selectmenu-hasIcon')
                                .addClass('ui-selectmenu-hasIcon');
-                            if(o.icons[j].icon){
-                                thisLi
-                                    .find('a:eq(0)')
-                                    .prepend('<span class="ui-icon '+o.icons[j].icon + '"></span>');
-                            }    
+                            var iconClass = o.icons[j].icon || "";
+                            
+                            thisLi
+                                .find('a:eq(0)')
+                                .prepend('<span class="ui-selectmenu-item-icon ui-icon '+iconClass
+ '"></span>');
                        }
                    }
                }