diff options
-rw-r--r-- | demos/autocomplete/categories.html | 23 | ||||
-rw-r--r-- | ui/jquery.ui.autocomplete.js | 6 |
2 files changed, 3 insertions, 26 deletions
diff --git a/demos/autocomplete/categories.html b/demos/autocomplete/categories.html index 2340b32f4..bb59bf31e 100644 --- a/demos/autocomplete/categories.html +++ b/demos/autocomplete/categories.html @@ -19,29 +19,6 @@ } </style> <script type="text/javascript"> - $.extend( $.ui.menu.prototype, { - next: function() { - this.move("next", ".ui-menu-item:first"); - }, - - previous: function() { - this.move("prev", ".ui-menu-item:last"); - }, - - move: function(direction, edge) { - if (!this.active) { - this.activate(this.element.children(edge)); - return; - } - var next = this.active[direction + "All"]('.ui-menu-item').eq( 0 ); - if (next.length) { - this.activate(next); - } else { - this.activate(this.element.children(edge)); - } - } - }); - $.widget("custom.catcomplete", $.ui.autocomplete, { _renderMenu: function( ul, items ) { var self = this, diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js index f9fa50380..c5b78a6e3 100644 --- a/ui/jquery.ui.autocomplete.js +++ b/ui/jquery.ui.autocomplete.js @@ -391,11 +391,11 @@ $.widget("ui.menu", { }, next: function(event) { - this.move("next", "li:first", event); + this.move("next", ".ui-menu-item:first", event); }, previous: function(event) { - this.move("prev", "li:last", event); + this.move("prev", ".ui-menu-item:last", event); }, first: function() { @@ -411,7 +411,7 @@ $.widget("ui.menu", { this.activate(event, this.element.children(edge)); return; } - var next = this.active[direction](); + var next = this.active[direction + "All"](".ui-menu-item").eq(0); if (next.length) { this.activate(event, next); } else { |