From bf977a677059b48a6d34974645388aa3876e1655 Mon Sep 17 00:00:00 2001 From: jzaefferer Date: Sat, 19 Jun 2010 17:16:15 +0200 Subject: [PATCH] Menu: Improve first and last methods to take non-menuitem items into account --- ui/jquery.ui.menu.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js index b81915fd7d0..e4f6990d513 100644 --- a/ui/jquery.ui.menu.js +++ b/ui/jquery.ui.menu.js @@ -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) {