Skip to content

Commit

Permalink
Autocomplete demo: Added styling to the categories.
Browse files Browse the repository at this point in the history
  • Loading branch information
scottgonzalez committed Feb 17, 2010
1 parent 5aaae1d commit d3141b8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions demos/autocomplete/categories.html
Expand Up @@ -10,7 +10,10 @@
<script type="text/javascript" src="../../ui/jquery.ui.autocomplete.js"></script> <script type="text/javascript" src="../../ui/jquery.ui.autocomplete.js"></script>
<link type="text/css" href="../demos.css" rel="stylesheet" /> <link type="text/css" href="../demos.css" rel="stylesheet" />
<style type="text/css"> <style type="text/css">

.ui-autocomplete-category {
padding:.2em .4em;
line-height:1.5;
}
</style> </style>
<script type="text/javascript"> <script type="text/javascript">
$.each({ $.each({
Expand Down Expand Up @@ -57,7 +60,7 @@
currentCategory = ""; currentCategory = "";
$.each( items, function( index, item ) { $.each( items, function( index, item ) {
if ( item.category != currentCategory ) { if ( item.category != currentCategory ) {
ul.append( "<li class='category'>" + item.category + "</li>" ); ul.append( "<li class='ui-widget-header ui-autocomplete-category'>" + item.category + "</li>" );
currentCategory = item.category; currentCategory = item.category;
} }
self._renderItem( ul, item ); self._renderItem( ul, item );
Expand Down

0 comments on commit d3141b8

Please sign in to comment.