Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

Fixes #5188 - Refactor menu rendering for more customizing.
  • Loading branch information...
commit 22ba931c395aa8859c0cc7a2cf08e7bb0027db78 1 parent 65d8fa2
Scott González authored March 20, 2010
23  demos/autocomplete/categories.html
@@ -19,29 +19,6 @@
19 19
 	}
20 20
 	</style>
21 21
 	<script type="text/javascript">
22  
-	$.extend( $.ui.menu.prototype, {
23  
-		next: function() {
24  
-			this.move("next", ".ui-menu-item:first");
25  
-		},
26  
-
27  
-		previous: function() {
28  
-			this.move("prev", ".ui-menu-item:last");
29  
-		},
30  
-
31  
-		move: function(direction, edge) {
32  
-			if (!this.active) {
33  
-				this.activate(this.element.children(edge));
34  
-				return;
35  
-			}
36  
-			var next = this.active[direction + "All"]('.ui-menu-item').eq( 0 );
37  
-			if (next.length) {
38  
-				this.activate(next);
39  
-			} else {
40  
-				this.activate(this.element.children(edge));
41  
-			}
42  
-		}
43  
-	});
44  
-
45 22
 	$.widget("custom.catcomplete", $.ui.autocomplete, {
46 23
 		_renderMenu: function( ul, items ) {
47 24
 			var self = this,
6  ui/jquery.ui.autocomplete.js
@@ -391,11 +391,11 @@ $.widget("ui.menu", {
391 391
 	},
392 392
 
393 393
 	next: function(event) {
394  
-		this.move("next", "li:first", event);
  394
+		this.move("next", ".ui-menu-item:first", event);
395 395
 	},
396 396
 
397 397
 	previous: function(event) {
398  
-		this.move("prev", "li:last", event);
  398
+		this.move("prev", ".ui-menu-item:last", event);
399 399
 	},
400 400
 
401 401
 	first: function() {
@@ -411,7 +411,7 @@ $.widget("ui.menu", {
411 411
 			this.activate(event, this.element.children(edge));
412 412
 			return;
413 413
 		}
414  
-		var next = this.active[direction]();
  414
+		var next = this.active[direction + "All"](".ui-menu-item").eq(0);
415 415
 		if (next.length) {
416 416
 			this.activate(event, next);
417 417
 		} else {

0 notes on commit 22ba931

Please sign in to comment.
Something went wrong with that request. Please try again.