Menu: Improve first and last methods to take non-menuitem items into account

This commit is contained in:
jzaefferer 2010-06-19 17:16:15 +02:00
parent d5df3a5a56
commit bf977a6770

View File

@ -155,11 +155,11 @@ $.widget("ui.menu", {
},
first: function() {
return this.active && !this.active.prev().length;
return this.active && !this.active.prevAll(".ui-menu-item").length;
},
last: function() {
return this.active && !this.active.next().length;
return this.active && !this.active.nextAll(".ui-menu-item").length;
},
_move: function(direction, edge, event) {