diff options
author | jzaefferer <joern.zaefferer@gmail.com> | 2011-04-23 17:36:52 +0200 |
---|---|---|
committer | jzaefferer <joern.zaefferer@gmail.com> | 2011-04-23 17:36:52 +0200 |
commit | 6326da3fdb29ea4f40e39bc06abf14cde5ba5c8c (patch) | |
tree | b1aec2436d921d451de7e27e159ab11366e276df /ui | |
parent | 49556995d2dffb7b57169bc2462aef5e17370d41 (diff) | |
download | jquery-ui-6326da3fdb29ea4f40e39bc06abf14cde5ba5c8c.tar.gz jquery-ui-6326da3fdb29ea4f40e39bc06abf14cde5ba5c8c.zip |
Menu: Add ui-state-active to parent item when submenu item receives focus.
Diffstat (limited to 'ui')
-rw-r--r-- | ui/jquery.ui.menu.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js index 3b48d29a3..7c0c8d3d3 100644 --- a/ui/jquery.ui.menu.js +++ b/ui/jquery.ui.menu.js @@ -229,6 +229,9 @@ $.widget("ui.menu", { // need to remove the attribute before adding it for the screenreader to pick up the change // see http://groups.google.com/group/jquery-a11y/msg/929e0c1e8c5efc8f this.element.removeAttr("aria-activedescendant").attr("aria-activedescendant", self.itemId) + + // highlight active parent menu item, if any + this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"); self.timer = setTimeout(function() { self._close(); @@ -277,8 +280,6 @@ $.widget("ui.menu", { ); submenu.show().position(position); - - this.active.find(">a:first").addClass("ui-state-active"); }, closeAll: function() { |