aboutsummaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2010-02-17 03:28:18 +0000
committerScott González <scott.gonzalez@gmail.com>2010-02-17 03:28:18 +0000
commit1342b2a8670c56858899cc2a620342caf524c726 (patch)
tree757f4691fe68b28daadc1eb522857a1584a6c361 /demos
parentd3141b84cb2cbfe6c01a3629623e5d4e6730e044 (diff)
downloadjquery-ui-1342b2a8670c56858899cc2a620342caf524c726.tar.gz
jquery-ui-1342b2a8670c56858899cc2a620342caf524c726.zip
Autocomplete categories demo: Removed custom jQuery methods and tweaked the category styling.
Diffstat (limited to 'demos')
-rw-r--r--demos/autocomplete/categories.html20
1 files changed, 3 insertions, 17 deletions
diff --git a/demos/autocomplete/categories.html b/demos/autocomplete/categories.html
index 524f7b67a..715efb6e6 100644
--- a/demos/autocomplete/categories.html
+++ b/demos/autocomplete/categories.html
@@ -12,25 +12,11 @@
<style type="text/css">
.ui-autocomplete-category {
padding:.2em .4em;
+ margin:.8em 0 .2em;
line-height:1.5;
}
</style>
<script type="text/javascript">
- $.each({
- prevOf: "previousSibling",
- nextOf: "nextSibling"
- }, function( method, traversal ) {
- $.fn[ method ] = function( selector ) {
- return this.pushStack( this.map(function() {
- var ret = this[ traversal ];
- while ( ret && !$( ret ).is( selector ) ) {
- ret = ret[ traversal ];
- }
- return ret;
- }) );
- };
- });
-
$.extend( $.ui.menu.prototype, {
next: function() {
this.move("next", ".ui-menu-item:first");
@@ -45,7 +31,7 @@
this.activate(this.element.children(edge));
return;
}
- var next = this.active[direction + "Of"]('.ui-menu-item');
+ var next = this.active[direction + "All"]('.ui-menu-item').eq( 0 );
if (next.length) {
this.activate(next);
} else {
@@ -60,7 +46,7 @@
currentCategory = "";
$.each( items, function( index, item ) {
if ( item.category != currentCategory ) {
- ul.append( "<li class='ui-widget-header ui-autocomplete-category'>" + item.category + "</li>" );
+ ul.append( "<li class='ui-widget-header ui-autocomplete-category ui-corner-all'>" + item.category + "</li>" );
currentCategory = item.category;
}
self._renderItem( ul, item );