Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Menu: skip over elements that aren't menu items.

Fixes #5188 - Refactor menu rendering for more customizing.
commit 22ba931c395aa8859c0cc7a2cf08e7bb0027db78 1 parent 65d8fa2
@scottgonzalez scottgonzalez authored
Showing with 3 additions and 26 deletions.
  1. +0 −23 demos/autocomplete/categories.html
  2. +3 −3 ui/jquery.ui.autocomplete.js
View
23 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,
View
6 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 {
Please sign in to comment.
Something went wrong with that request. Please try again.