summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalph Bean <ralph.bean@gmail.com>2011-04-13 21:39:00 -0400
committerRalph Bean <ralph.bean@gmail.com>2011-04-13 21:39:00 -0400
commitbb25bbe6ff486cb1daf814aa3c8ac1cf14c5e1bc (patch)
tree8fb078e1ea7b701be672a40c1d92b936239ca5bd
parentefa93d8af8e22663383f163b9b81c3aecae5f60f (diff)
downloadleafymiracle-bb25bbe6ff486cb1daf814aa3c8ac1cf14c5e1bc.zip
leafymiracle-bb25bbe6ff486cb1daf814aa3c8ac1cf14c5e1bc.tar.gz
leafymiracle-bb25bbe6ff486cb1daf814aa3c8ac1cf14c5e1bc.tar.xz
Bugfix to show categories again!
-rw-r--r--leafymiracle/static/js/searchbar_html_support.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/leafymiracle/static/js/searchbar_html_support.js b/leafymiracle/static/js/searchbar_html_support.js
index 4d07901..f3ed642 100644
--- a/leafymiracle/static/js/searchbar_html_support.js
+++ b/leafymiracle/static/js/searchbar_html_support.js
@@ -4,6 +4,16 @@
$(document).ready(function() {
$.widget( "custom.catcomplete", $.ui.autocomplete, {
+ _renderMenu: function( ul, items ) {
+ var self = this, currentCategory = "";
+ $.each( items, function( index, item ) {
+ if ( item.category != currentCategory ) {
+ ul.append( '<li class="ui-autocomplete-category">' + item.category + "</li>" );
+ currentCategory = item.category;
+ }
+ self._renderItem( ul, item );
+ });
+ },
_renderItem: function( ul, item) {
return $( "<li></li>" )
.data( "item.autocomplete", item )